File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed
spring-data-jdbc/src/main/java/org/springframework/data/jdbc/repository/query Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change 1818import java .util .ArrayList ;
1919import java .util .List ;
2020import java .util .Optional ;
21+ import java .util .function .Predicate ;
2122
2223import org .springframework .data .domain .Pageable ;
2324import org .springframework .data .domain .Sort ;
@@ -261,6 +262,8 @@ private SelectBuilder.SelectJoin selectBuilder(Table table) {
261262 List <Expression > columnExpressions = new ArrayList <>();
262263 RelationalPersistentEntity <?> entity = entityMetadata .getTableEntity ();
263264
265+ Predicate <AggregatePath > filter = ap -> returnedType .needsCustomConstruction () && !returnedType .getInputProperties ().contains (ap .getRequiredBaseProperty ().getName ());
266+
264267// sqlGeneratorSource.getSqlGenerator(entity.getType()).createSelectBuilder(
265268//
266269// , table)
@@ -274,11 +277,7 @@ private SelectBuilder.SelectJoin selectBuilder(Table table) {
274277 AggregatePath aggregatePath = context .getAggregatePath (path );
275278
276279 // TODO: special handling for custom construction?
277- if (returnedType .needsCustomConstruction ()) {
278- if (!returnedType .getInputProperties ().contains (aggregatePath .getRequiredBaseProperty ().getName ())) {
279- continue ;
280- }
281- }
280+ if (filter .test (aggregatePath )) { continue ;}
282281
283282 // add a join if necessary
284283 Join join = getJoin (sqlContext , aggregatePath );
You can’t perform that action at this time.
0 commit comments