@@ -44,16 +44,18 @@ public static List<PropertyPath> getInputProperties(ResultProcessor resultProces
44
44
List <PropertyPath > filteredProperties = new ArrayList <>();
45
45
46
46
boolean isProjecting = returnedType .isProjecting ();
47
+ boolean isClosedProjection = factory .getProjectionInformation (returnedType .getReturnedType ()).isClosed ();
48
+
49
+ if (!isProjecting || !isClosedProjection ) {
50
+ return Collections .emptyList ();
51
+ }
52
+
47
53
for (String inputProperty : returnedType .getInputProperties ()) {
48
- if (isProjecting ) {
49
- addPropertiesFrom (returnedType .getDomainType (), returnedType .getReturnedType (), factory ,
50
- filteredProperties , inputProperty , mappingContext );
51
- } else {
52
- addPropertiesFromEntity (filteredProperties , PropertyPath .from (inputProperty , returnedType .getDomainType ()),
53
- returnedType .getReturnedType (), mappingContext , new HashSet <>());
54
- }
54
+ addPropertiesFrom (returnedType .getDomainType (), returnedType .getReturnedType (), factory ,
55
+ filteredProperties , inputProperty , mappingContext );
55
56
}
56
- return isProjecting ? filteredProperties : Collections .emptyList ();
57
+
58
+ return filteredProperties ;
57
59
}
58
60
59
61
public static List <PropertyPath > addPropertiesFrom (Class <?> returnType , Class <?> domainType ,
@@ -161,11 +163,11 @@ private static void takeAllPropertiesFromEntity(Collection<PropertyPath> filtere
161
163
filteredProperties .add (propertyPath );
162
164
163
165
persistentEntityFromProperty .doWithAll (neo4jPersistentProperty -> {
164
- addPropertiesFrom (filteredProperties , propertyPath .nested (neo4jPersistentProperty .getFieldName ()), mappingContext , processedEntities );
166
+ addPropertiesFromEntity (filteredProperties , propertyPath .nested (neo4jPersistentProperty .getFieldName ()), mappingContext , processedEntities );
165
167
});
166
168
}
167
169
168
- private static void addPropertiesFrom (Collection <PropertyPath > filteredProperties , PropertyPath propertyPath ,
170
+ private static void addPropertiesFromEntity (Collection <PropertyPath > filteredProperties , PropertyPath propertyPath ,
169
171
Neo4jMappingContext mappingContext ,
170
172
Collection <Neo4jPersistentEntity <?>> processedEntities ) {
171
173
0 commit comments