Java 类org.springframework.data.repository.core.support.DefaultRepositoryMetadata 实例源码

项目:crud-admin-spring-boot-starter    文件:CrudAdminUtils.java   
public static CrudAdminRepository getDomainClass(PagingAndSortingRepository<?, ?> repo) {
    try {
        Class<?>[] classes = repo.getClass().getInterfaces();
        Class<?> repoClass = classes[0];
        DefaultRepositoryMetadata metadata = new DefaultRepositoryMetadata(repoClass);
        CrudAdminRepository repoAdmin = new CrudAdminRepository(repo, metadata);
        return repoAdmin;
    } catch (Exception ex) {
        throw new RuntimeException(ex);
    }
}
项目:spring-data-gclouddatastore    文件:GcloudDatastoreQueryCreatorTests.java   
private GcloudDatastoreQueryCreator createCreator(Class<?> repositoryClass,
        Method method, Object... values) {

    QueryMethod queryMethod = new QueryMethod(method,
            new DefaultRepositoryMetadata(repositoryClass),
            new SpelAwareProxyProjectionFactory());
    return new GcloudDatastoreQueryCreator(
            new PartTree(method.getName(),
                    queryMethod.getResultProcessor().getReturnedType()
                            .getDomainType()),
            new ParametersParameterAccessor(queryMethod.getParameters(), values),
            DatastoreOptions.getDefaultInstance());
}
项目:mongodb-aggregate-query-support    文件:AggregateQueryProvider2Test.java   
@Test(dataProvider = "queryMethods", expectedExceptions = {NullPointerException.class, IllegalArgumentException.class})
public void testCreateAggregateQuery(String methodName) throws Exception {
  AggregateQuerySupportingRepositoryFactory factory = new AggregateQuerySupportingRepositoryFactory(mongoOperations,
                                                                                                    queryExecutor);
  QueryLookupStrategy lookupStrategy = factory.getQueryLookupStrategy(CREATE_IF_NOT_FOUND, evaluationContextProvider);

  Method method = TestAggregateRepository22.class.getMethod(methodName);
  RepositoryMetadata repositoryMetadata = new DefaultRepositoryMetadata(TestAggregateRepository22.class);
  ProjectionFactory projectionFactory = new SpelAwareProxyProjectionFactory();
  RepositoryQuery query = lookupStrategy.resolveQuery(method, repositoryMetadata, projectionFactory, null);
  assertNotNull(query);
  Object object = query.execute(new Object[0]);
  assertNull(object);
}
项目:crud-admin-spring-boot-starter    文件:CrudAdminRepository.java   
public CrudAdminRepository(PagingAndSortingRepository<?, ?> repository,
        DefaultRepositoryMetadata defaultRepositoryMetadata) {
    this.repository = repository;
    this.defaultRepositoryMetadata = defaultRepositoryMetadata;
}
项目:crud-admin-spring-boot-starter    文件:CrudAdminRepository.java   
public DefaultRepositoryMetadata getDefaultRepositoryMetadata() {
    return defaultRepositoryMetadata;
}
项目:crud-admin-spring-boot-starter    文件:CrudAdminRepository.java   
public void setDefaultRepositoryMetadata(DefaultRepositoryMetadata defaultRepositoryMetadata) {
    this.defaultRepositoryMetadata = defaultRepositoryMetadata;
}
项目:spring-data-solr    文件:SolrQueryMethodTests.java   
private SolrQueryMethod getQueryMethodByName(String name, Class<?>... parameters) throws Exception {
    Method method = Repo1.class.getMethod(name, parameters);
    return new SolrQueryMethod(method, new DefaultRepositoryMetadata(Repo1.class), creator);
}
项目:javers    文件:AbstractSpringAuditableRepositoryAspect.java   
private RepositoryMetadata getMetadata(Class versionedInterface) {
    return DefaultRepositoryMetadata.getMetadata(versionedInterface);
}