25
25
import org .springframework .data .mapping .PersistentEntity ;
26
26
import org .springframework .data .mapping .PersistentProperty ;
27
27
import org .springframework .data .mapping .PropertyPath ;
28
- import org .springframework .data .projection .EntityProjection .ProjectionType ;
29
28
import org .springframework .data .mapping .context .MappingContext ;
30
- import org .springframework .data .util . ClassTypeInformation ;
29
+ import org .springframework .data .projection . EntityProjection . ProjectionType ;
31
30
import org .springframework .data .util .TypeInformation ;
32
31
import org .springframework .lang .Nullable ;
33
32
import org .springframework .util .Assert ;
39
38
* @author Gerrit Meier
40
39
* @author Mark Paluch
41
40
* @author Christoph Strobl
41
+ * @author Oliver Drotbohm
42
42
* @since 2.7
43
43
*/
44
44
public class EntityProjectionIntrospector {
@@ -91,8 +91,8 @@ public static EntityProjectionIntrospector create(ProjectionFactory projectionFa
91
91
*/
92
92
public <M , D > EntityProjection <M , D > introspect (Class <M > mappedType , Class <D > domainType ) {
93
93
94
- ClassTypeInformation <M > returnedTypeInformation = ClassTypeInformation . from (mappedType );
95
- ClassTypeInformation <D > domainTypeInformation = ClassTypeInformation . from (domainType );
94
+ TypeInformation <M > returnedTypeInformation = TypeInformation . of (mappedType );
95
+ TypeInformation <D > domainTypeInformation = TypeInformation . of (domainType );
96
96
97
97
boolean isProjection = projectionPredicate .test (mappedType , domainType );
98
98
@@ -111,7 +111,8 @@ public <M, D> EntityProjection<M, D> introspect(Class<M> mappedType, Class<D> do
111
111
List <EntityProjection .PropertyProjection <?, ?>> propertyDescriptors = getProperties (null , projectionInformation ,
112
112
returnedTypeInformation , persistentEntity , null );
113
113
114
- return EntityProjection .projecting (returnedTypeInformation , domainTypeInformation , propertyDescriptors , ProjectionType .CLOSED );
114
+ return EntityProjection .projecting (returnedTypeInformation , domainTypeInformation , propertyDescriptors ,
115
+ ProjectionType .CLOSED );
115
116
}
116
117
117
118
private List <EntityProjection .PropertyProjection <?, ?>> getProperties (@ Nullable PropertyPath propertyPath ,
@@ -157,10 +158,12 @@ public <M, D> EntityProjection<M, D> introspect(Class<M> mappedType, Class<D> do
157
158
158
159
if (container ) {
159
160
propertyDescriptors .add (EntityProjection .ContainerPropertyProjection .projecting (nestedPropertyPath , property ,
160
- persistentProperty .getTypeInformation (), nestedPropertyDescriptors , ProjectionType .from (projectionInformation )));
161
+ persistentProperty .getTypeInformation (), nestedPropertyDescriptors ,
162
+ ProjectionType .from (projectionInformation )));
161
163
} else {
162
164
propertyDescriptors .add (EntityProjection .PropertyProjection .projecting (nestedPropertyPath , property ,
163
- persistentProperty .getTypeInformation (), nestedPropertyDescriptors , ProjectionType .from (projectionInformation )));
165
+ persistentProperty .getTypeInformation (), nestedPropertyDescriptors ,
166
+ ProjectionType .from (projectionInformation )));
164
167
}
165
168
166
169
} else {
0 commit comments