且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Spring Data Projection 加载额外的字段

更新时间:2023-09-23 23:17:34

似乎当投影包含非原始类型时,所有列都会包含在查询中.

It seems that when the projection contains non-primitive types, all columns will be included in the query.

这里已经有问题https://jira.spring.io/browse/DATAJPA-1218,而且从这个问题看来,目前无法通过预测解决这个问题.

There is already an issue here https://jira.spring.io/browse/DATAJPA-1218 , and it sounds from the issue that this can't be solved with projections for now.

这对你很有用 https://github.com/Blazebit/blaze-persistence一>,记录在此 实体视图一个>

This can be useful for you https://github.com/Blazebit/blaze-persistence , documented here Entity Views

它使用与投影类似的实现.

It uses similar implementation to projections.