private RepositoryMetadata getMetadata(Class versionedInterface) { return DefaultRepositoryMetadata.getMetadata(versionedInterface); }
/** * 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); }
@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 DefaultRepositoryMetadata} for the given repository interface. * * @param repositoryInterface must not be {@literal null}. */ public DefaultRepositoryMetadata(Class<?> repositoryInterface) { super(repositoryInterface); Assert.isTrue(Repository.class.isAssignableFrom(repositoryInterface), MUST_BE_A_REPOSITORY); List<TypeInformation<?>> arguments = ClassTypeInformation.from(repositoryInterface) // .getRequiredSuperTypeInformation(Repository.class)// .getTypeArguments(); this.domainType = resolveTypeParameter(arguments, 0, () -> String.format("Could not resolve domain type of %s!", repositoryInterface)); this.idType = resolveTypeParameter(arguments, 1, () -> String.format("Could not resolve id type of %s!", repositoryInterface)); }
/** * 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); }
@Override public Class<?> getReturnedDomainClass(final Method method) { if (ArangoCursor.class.isAssignableFrom(method.getReturnType())) { return typeInformation.getReturnType(method).getRequiredComponentType().getType(); } else { return super.getReturnedDomainClass(method); } }