13
13
* See the License for the specific language governing permissions and
14
14
* limitations under the License.
15
15
*/
16
- package org .springframework .data .aot ;
16
+ package org .springframework .data .repository . aot ;
17
17
18
18
import java .io .Serializable ;
19
19
import java .lang .annotation .Annotation ;
41
41
import org .springframework .core .DecoratingProxy ;
42
42
import org .springframework .core .ResolvableType ;
43
43
import org .springframework .core .annotation .AnnotationUtils ;
44
- import org .springframework .core .annotation .MergedAnnotation ;
44
+ import org .springframework .data .aot .AotContext ;
45
+ import org .springframework .data .aot .TypeContributor ;
46
+ import org .springframework .data .aot .TypeUtils ;
45
47
import org .springframework .data .projection .EntityProjectionIntrospector ;
46
48
import org .springframework .data .projection .TargetAware ;
47
49
import org .springframework .data .repository .Repository ;
@@ -73,7 +75,7 @@ public class RepositoryRegistrationAotContribution implements BeanRegistrationAo
73
75
* which this contribution was created.
74
76
* @return a new instance of {@link RepositoryRegistrationAotContribution}.
75
77
* @throws IllegalArgumentException if the {@link RepositoryRegistrationAotProcessor} is {@literal null}.
76
- * @see org.springframework.data.aot. RepositoryRegistrationAotProcessor
78
+ * @see RepositoryRegistrationAotProcessor
77
79
*/
78
80
public static RepositoryRegistrationAotContribution fromProcessor (
79
81
RepositoryRegistrationAotProcessor repositoryRegistrationAotProcessor ) {
@@ -94,7 +96,7 @@ public static RepositoryRegistrationAotContribution fromProcessor(
94
96
* @param repositoryRegistrationAotProcessor reference back to the {@link RepositoryRegistrationAotProcessor} from
95
97
* which this contribution was created.
96
98
* @throws IllegalArgumentException if the {@link RepositoryRegistrationAotProcessor} is {@literal null}.
97
- * @see org.springframework.data.aot. RepositoryRegistrationAotProcessor
99
+ * @see RepositoryRegistrationAotProcessor
98
100
*/
99
101
protected RepositoryRegistrationAotContribution (
100
102
RepositoryRegistrationAotProcessor repositoryRegistrationAotProcessor ) {
@@ -232,10 +234,6 @@ protected void enhanceRepositoryBeanDefinition(RegisteredBean repositoryBean,
232
234
}
233
235
}
234
236
235
- private boolean isRepositoryWithTypeParameters (ResolvableType type ) {
236
- return type .getGenerics ().length == 3 ;
237
- }
238
-
239
237
/**
240
238
* {@link BiConsumer Callback} for data module specific contributions.
241
239
*
@@ -380,24 +378,14 @@ static boolean isJavaOrPrimitiveType(Class<?> type) {
380
378
|| ClassUtils .isPrimitiveArray (type ); //
381
379
}
382
380
383
- static boolean isSpringDataManagedAnnotation (@ Nullable MergedAnnotation <?> annotation ) {
384
-
385
- return annotation != null && (isInSpringDataNamespace (annotation .getType ())
386
- || annotation .getMetaTypes ().stream ().anyMatch (RepositoryRegistrationAotContribution ::isInSpringDataNamespace ));
387
- }
388
-
389
- static boolean isInSpringDataNamespace (Class <?> type ) {
390
- return type .getPackage ().getName ().startsWith (TypeContributor .DATA_NAMESPACE );
391
- }
392
-
393
- static void contributeType (Class <?> type , GenerationContext generationContext ) {
394
- TypeContributor .contribute (type , it -> true , generationContext );
395
- }
396
-
397
381
// TODO What was this meant to be used for? Was this type filter maybe meant to be used in
398
382
// the TypeContributor.contribute(:Class, :Predicate :GenerationContext) method
399
383
// used in the contributeType(..) method above?
400
384
public Predicate <Class <?>> typeFilter () { // like only document ones. // TODO: As in MongoDB?
401
385
return it -> true ;
402
386
}
387
+
388
+ private static boolean isRepositoryWithTypeParameters (ResolvableType type ) {
389
+ return type .getGenerics ().length == 3 ;
390
+ }
403
391
}
0 commit comments