/** * Returns the {@link RepositoryMetadata} for the given repository interface. * * @param repositoryInterface * @return */ RepositoryMetadata getRepositoryMetadata(Class<?> repositoryInterface) { return Repository.class.isAssignableFrom(repositoryInterface) ? new DefaultRepositoryMetadata(repositoryInterface) : new AnnotationRepositoryMetadata(repositoryInterface); }
/** * Creates a new {@link AnnotationRepositoryMetadata} instance looking up repository types from a * {@link RepositoryDefinition} annotation. * * @param repositoryInterface must not be {@literal null}. */ public AnnotationRepositoryMetadata(Class<?> repositoryInterface) { super(repositoryInterface); Assert.isTrue(repositoryInterface.isAnnotationPresent(RepositoryDefinition.class), String.format(NO_ANNOTATION_FOUND, repositoryInterface.getName())); this.idType = resolveIdType(repositoryInterface); this.domainType = resolveDomainType(repositoryInterface); }
@Override public Class<?> getReturnedDomainClass(final Method method) { if (ArangoCursor.class.isAssignableFrom(method.getReturnType())) { return typeInformation.getReturnType(method).getRequiredComponentType().getType(); } else { return super.getReturnedDomainClass(method); } }
@Override public Class<?> getReturnedDomainClass(final Method method) { if (ArangoCursor.class.isAssignableFrom(method.getReturnType())) { return typeInformation.getReturnType(method).getRequiredComponentType().getType(); } else { return super.getReturnedDomainClass(method); } }
/** * Creates a new {@link RepositoryMetadata} for the given repository interface. * * @param repositoryInterface must not be {@literal null}. * @since 1.9 * @return */ public static RepositoryMetadata getMetadata(Class<?> repositoryInterface) { Assert.notNull(repositoryInterface, "Repository interface must not be null!"); return Repository.class.isAssignableFrom(repositoryInterface) ? new DefaultRepositoryMetadata(repositoryInterface) : new AnnotationRepositoryMetadata(repositoryInterface); }