/** * Creates a new {@link RepositoryAwareResourceMetadata} for the given {@link CollectionResourceMapping}, * {@link ResourceMappings} and {@link RepositoryMetadata}. * * @param entity must not be {@literal null}. * @param mapping must not be {@literal null}. * @param provider must not be {@literal null}. * @param repositoryMetadata must not be {@literal null}. */ public RepositoryAwareResourceMetadata(PersistentEntity<?, ?> entity, CollectionResourceMapping mapping, RepositoryResourceMappings provider, RepositoryMetadata repositoryMetadata) { Assert.notNull(entity, "PersistentEntity must not be null!"); Assert.notNull(mapping, "CollectionResourceMapping must not be null!"); Assert.notNull(provider, "ResourceMetadataProvider must not be null!"); Assert.notNull(repositoryMetadata, "RepositoryMetadata must not be null!"); this.mapping = mapping; this.provider = provider; this.repositoryMetadata = repositoryMetadata; CrudMethodsSupportedHttpMethods httpMethods = new CrudMethodsSupportedHttpMethods( repositoryMetadata.getCrudMethods(), provider.exposeMethodsByDefault()); this.crudMethodsSupportedHttpMethods = new ConfigurationApplyingSupportedHttpMethodsAdapter( provider.getExposureConfiguration(), this, httpMethods); }
@Override public CrudMethods getCrudMethods() { return metadata.getCrudMethods(); }
@Override public CrudMethods getCrudMethods() { return metadata.getCrudMethods(); }
@Override public CrudMethods getCrudMethods() { return metadata.getCrudMethods(); }
@Override public CrudMethods getCrudMethods() { return metadata.getCrudMethods(); }
@Override public CrudMethods getCrudMethods() { return metadata.getCrudMethods(); }
@Override public CrudMethods getCrudMethods() { return metadata.getCrudMethods(); }
@Override public CrudMethods getCrudMethods() { return metadata.getCrudMethods(); }
@Override public CrudMethods getCrudMethods() { return metadata.getCrudMethods(); }
@Override public CrudMethods getCrudMethods() { return metadata.getCrudMethods(); }
@Override public CrudMethods getCrudMethods() { return metadata.getCrudMethods(); }
@Override public CrudMethods getCrudMethods() { return metadata.getCrudMethods(); }
@Override public CrudMethods getCrudMethods() { return metadata.getCrudMethods(); }
@Override public CrudMethods getCrudMethods() { return metadata.getCrudMethods(); }
/** * Creates a new {@link ReflectionRepositoryInvoker} for the given repository, {@link RepositoryMetadata} and * {@link ConversionService}. * * @param repository must not be {@literal null}. * @param metadata must not be {@literal null}. * @param conversionService must not be {@literal null}. */ public ReflectionRepositoryInvoker(Object repository, RepositoryMetadata metadata, ConversionService conversionService) { Assert.notNull(repository, "Repository must not be null!"); Assert.notNull(metadata, "RepositoryMetadata must not be null!"); Assert.notNull(conversionService, "ConversionService must not be null!"); this.repository = repository; this.methods = metadata.getCrudMethods(); this.idType = metadata.getIdType(); this.conversionService = conversionService; }
/** * Creates a new {@link PagingAndSortingRepositoryInvoker} using the given repository, {@link RepositoryMetadata} and * {@link ConversionService}. * * @param repository must not be {@literal null}. * @param metadata must not be {@literal null}. * @param conversionService must not be {@literal null}. */ public PagingAndSortingRepositoryInvoker(PagingAndSortingRepository<Object, Object> repository, RepositoryMetadata metadata, ConversionService conversionService) { super(repository, metadata, conversionService); CrudMethods crudMethods = metadata.getCrudMethods(); this.repository = repository; this.customFindAll = isRedeclaredMethod(crudMethods.getFindAllMethod()); }
/** * Creates a new {@link CrudRepositoryInvoker} for the given {@link CrudRepository}, {@link RepositoryMetadata} and * {@link ConversionService}. * * @param repository must not be {@literal null}. * @param metadata must not be {@literal null}. * @param conversionService must not be {@literal null}. */ public CrudRepositoryInvoker(CrudRepository<Object, Object> repository, RepositoryMetadata metadata, ConversionService conversionService) { super(repository, metadata, conversionService); CrudMethods crudMethods = metadata.getCrudMethods(); this.customSaveMethod = isRedeclaredMethod(crudMethods.getSaveMethod()); this.customFindOneMethod = isRedeclaredMethod(crudMethods.getFindOneMethod()); this.customDeleteMethod = isRedeclaredMethod(crudMethods.getDeleteMethod()); this.customFindAllMethod = isRedeclaredMethod(crudMethods.getFindAllMethod()); this.repository = repository; }