1313 * See the License for the specific language governing permissions and
1414 * limitations under the License.
1515 */
16- package org .springframework .data .aot ;
16+ package org .springframework .data .repository . aot ;
1717
1818import java .io .Serializable ;
1919import java .lang .annotation .Annotation ;
4141import org .springframework .core .DecoratingProxy ;
4242import org .springframework .core .ResolvableType ;
4343import 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 ;
4547import org .springframework .data .projection .EntityProjectionIntrospector ;
4648import org .springframework .data .projection .TargetAware ;
4749import org .springframework .data .repository .Repository ;
@@ -73,7 +75,7 @@ public class RepositoryRegistrationAotContribution implements BeanRegistrationAo
7375 * which this contribution was created.
7476 * @return a new instance of {@link RepositoryRegistrationAotContribution}.
7577 * @throws IllegalArgumentException if the {@link RepositoryRegistrationAotProcessor} is {@literal null}.
76- * @see org.springframework.data.aot. RepositoryRegistrationAotProcessor
78+ * @see RepositoryRegistrationAotProcessor
7779 */
7880 public static RepositoryRegistrationAotContribution fromProcessor (
7981 RepositoryRegistrationAotProcessor repositoryRegistrationAotProcessor ) {
@@ -94,7 +96,7 @@ public static RepositoryRegistrationAotContribution fromProcessor(
9496 * @param repositoryRegistrationAotProcessor reference back to the {@link RepositoryRegistrationAotProcessor} from
9597 * which this contribution was created.
9698 * @throws IllegalArgumentException if the {@link RepositoryRegistrationAotProcessor} is {@literal null}.
97- * @see org.springframework.data.aot. RepositoryRegistrationAotProcessor
99+ * @see RepositoryRegistrationAotProcessor
98100 */
99101 protected RepositoryRegistrationAotContribution (
100102 RepositoryRegistrationAotProcessor repositoryRegistrationAotProcessor ) {
@@ -232,10 +234,6 @@ protected void enhanceRepositoryBeanDefinition(RegisteredBean repositoryBean,
232234 }
233235 }
234236
235- private boolean isRepositoryWithTypeParameters (ResolvableType type ) {
236- return type .getGenerics ().length == 3 ;
237- }
238-
239237 /**
240238 * {@link BiConsumer Callback} for data module specific contributions.
241239 *
@@ -380,24 +378,14 @@ static boolean isJavaOrPrimitiveType(Class<?> type) {
380378 || ClassUtils .isPrimitiveArray (type ); //
381379 }
382380
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-
397381 // TODO What was this meant to be used for? Was this type filter maybe meant to be used in
398382 // the TypeContributor.contribute(:Class, :Predicate :GenerationContext) method
399383 // used in the contributeType(..) method above?
400384 public Predicate <Class <?>> typeFilter () { // like only document ones. // TODO: As in MongoDB?
401385 return it -> true ;
402386 }
387+
388+ private static boolean isRepositoryWithTypeParameters (ResolvableType type ) {
389+ return type .getGenerics ().length == 3 ;
390+ }
403391}
0 commit comments