@@ -102,7 +102,6 @@ public <M, D> EntityProjection<M, D> introspect(Class<M> mappedType, Class<D> do
102
102
false );
103
103
}
104
104
105
-
106
105
PersistentEntity <?, ?> persistentEntity = mappingContext .getRequiredPersistentEntity (domainType );
107
106
List <PropertyProjection <?, ?>> propertyDescriptors = getProperties (null , projectionInformation ,
108
107
returnedTypeInformation ,
@@ -111,12 +110,13 @@ public <M, D> EntityProjection<M, D> introspect(Class<M> mappedType, Class<D> do
111
110
return EntityProjection .projecting (returnedTypeInformation , domainTypeInformation , propertyDescriptors , true );
112
111
}
113
112
114
-
115
113
private List <PropertyProjection <?, ?>> getProperties (@ Nullable PropertyPath propertyPath ,
116
114
ProjectionInformation projectionInformation , TypeInformation <?> projectionTypeInformation ,
117
115
PersistentEntity <?, ?> persistentEntity , @ Nullable CycleGuard cycleGuard ) {
118
116
119
117
List <PropertyProjection <?, ?>> propertyDescriptors = new ArrayList <>();
118
+
119
+ // TODO: PropertyDescriptor only created for DTO's with getters/setters
120
120
for (PropertyDescriptor inputProperty : projectionInformation .getInputProperties ()) {
121
121
122
122
PersistentProperty <?> persistentProperty = persistentEntity .getPersistentProperty (inputProperty .getName ());
@@ -228,6 +228,18 @@ public static <M, D> EntityProjection<M, D> nonProjecting(TypeInformation<M> map
228
228
return new EntityProjection <>(mappedType , domainType , properties , false , false );
229
229
}
230
230
231
+ /**
232
+ * Create a non-projecting variant of a mapped type.
233
+ *
234
+ * @param mappedType
235
+ * @param domainType
236
+ * @return
237
+ */
238
+ public static <T > EntityProjection <T , T > nonProjecting (Class <T > type ) {
239
+ ClassTypeInformation <T > typeInformation = ClassTypeInformation .from (type );
240
+ return new EntityProjection <>(typeInformation , typeInformation , Collections .emptyList (), false , false );
241
+ }
242
+
231
243
/**
232
244
* @return the mapped type used by this type view.
233
245
*/
0 commit comments