/** * Returns a repository instance for the given interface backed by an instance providing implementation logic for * custom logic. * * @param repositoryInterface must not be {@literal null}. * @param customImplementation must not be {@literal null}. * @return * @deprecated since 2.0. Use {@link RepositoryFragments} with {@link #getRepository(Class, RepositoryFragments)} to * compose repositories backed by custom implementations. */ @Deprecated public <T> T getRepository(Class<T> repositoryInterface, Object customImplementation) { return getRepository(repositoryInterface, RepositoryFragments.just(customImplementation)); }
@Override protected RepositoryFragments getRepositoryFragments(RepositoryMetadata metadata) { Object fragmentImplementation = getTargetRepositoryViaReflection( // EnversRevisionRepositoryImpl.class, // getEntityInformation(metadata.getDomainType()), // revisionEntityInformation, // entityManager // ); return RepositoryFragments // .just(fragmentImplementation) // .append(super.getRepositoryFragments(metadata)); } }
/** * Create a {@link RepositoryComposition} for just a single {@code implementation} with {@link MethodLookups#direct()) * method lookup. * * @param implementation must not be {@literal null}. * @return the {@link RepositoryComposition} for a single {@code implementation}. */ public static RepositoryComposition just(Object implementation) { return new RepositoryComposition(RepositoryFragments.just(implementation), MethodLookups.direct(), PASSTHRU_ARG_CONVERTER); }