Java 类org.springframework.data.repository.config.AnnotationRepositoryConfigurationSource 实例源码

项目:spring-boot-starter-data-mybatis    文件:MybatisRepositoriesAutoConfigureRegistrar.java   
private AnnotationRepositoryConfigurationSource getConfigurationSource(
    BeanDefinitionRegistry registry) {
  StandardAnnotationMetadata metadata = new StandardAnnotationMetadata(
      getConfiguration(), true);
  return new MybatisAnnotationRepositoryConfigurationSource(metadata, getAnnotation(),
      resourceLoader, this.environment, registry) {
    @Override
    public String[] getMapperLocations() {
      return MybatisRepositoriesAutoConfigureRegistrar.this.getMapperLocations();
    }

    @Override
    public Iterable<String> getBasePackages() {
      return MybatisRepositoriesAutoConfigureRegistrar.this.getBasePackages();
    }
  };
}
项目:lodsve-framework    文件:MongoBeanDefinitionRegistrar.java   
private void initMongoRepository(AnnotationMetadata annotationMetadata, BeanDefinitionRegistry registry) {
    AnnotationRepositoryConfigurationSource configurationSource = new LodsveAnnotationRepositoryConfigurationSource(annotationMetadata, EnableMongo.class, resourceLoader, environment);
    RepositoryConfigurationExtension extension = new LodsveMongoRepositoryConfigurationExtension(MONGO_TEMPLATE_BEAN_NAME);
    RepositoryConfigurationUtils.exposeRegistration(extension, registry, configurationSource);

    RepositoryConfigurationDelegate delegate = new RepositoryConfigurationDelegate(configurationSource, resourceLoader, environment);
    delegate.registerRepositoriesIn(registry, extension);
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:AbstractRepositoryConfigurationSourceSupport.java   
private AnnotationRepositoryConfigurationSource getConfigurationSource() {
    StandardAnnotationMetadata metadata = new StandardAnnotationMetadata(
            getConfiguration(), true);
    return new AnnotationRepositoryConfigurationSource(metadata, getAnnotation(),
            this.resourceLoader, this.environment) {
        @Override
        public java.lang.Iterable<String> getBasePackages() {
            return AbstractRepositoryConfigurationSourceSupport.this
                    .getBasePackages();
        }
    };
}
项目:spring-boot-concourse    文件:AbstractRepositoryConfigurationSourceSupport.java   
private AnnotationRepositoryConfigurationSource getConfigurationSource() {
    StandardAnnotationMetadata metadata = new StandardAnnotationMetadata(
            getConfiguration(), true);
    return new AnnotationRepositoryConfigurationSource(metadata, getAnnotation(),
            this.resourceLoader, this.environment) {
        @Override
        public java.lang.Iterable<String> getBasePackages() {
            return AbstractRepositoryConfigurationSourceSupport.this
                    .getBasePackages();
        }
    };
}
项目:contestparser    文件:AbstractRepositoryConfigurationSourceSupport.java   
private AnnotationRepositoryConfigurationSource getConfigurationSource() {
    StandardAnnotationMetadata metadata = new StandardAnnotationMetadata(
            getConfiguration(), true);
    return new AnnotationRepositoryConfigurationSource(metadata, getAnnotation(),
            this.resourceLoader, this.environment) {
        @Override
        public java.lang.Iterable<String> getBasePackages() {
            return AbstractRepositoryConfigurationSourceSupport.this
                    .getBasePackages();
        }
    };
}
项目:dubbox-solr    文件:SolrRepositoryConfigExtension.java   
@Override
public void postProcess(BeanDefinitionBuilder builder, AnnotationRepositoryConfigurationSource config) {

    AnnotationAttributes attributes = config.getAttributes();
    if (!attributes.getBoolean("multicoreSupport")) {
        builder.addPropertyReference(BeanDefinition.SOLR_OPERATIONS.getBeanName(),
                attributes.getString("solrTemplateRef"));
    } else {
        builder.addPropertyReference(BeanDefinition.SOLR_CLIENT.getBeanName(), attributes.getString("solrClientRef"));
    }
    builder.addPropertyValue("schemaCreationSupport", attributes.getBoolean("schemaCreationSupport"));
    builder.addPropertyReference(BeanDefinition.SOLR_MAPPTING_CONTEXT.getBeanName(), "solrMappingContext");
}
项目:ef-orm    文件:GqRepositoryConfigExtension.java   
@Override
public void postProcess(BeanDefinitionBuilder builder, AnnotationRepositoryConfigurationSource config) {

    AnnotationAttributes attributes = config.getAttributes();

    builder.addPropertyValue(ENABLE_DEFAULT_TRANSACTIONS_ATTRIBUTE,
            attributes.getBoolean(ENABLE_DEFAULT_TRANSACTIONS_ATTRIBUTE));
}
项目:spring-data-solr    文件:SolrRepositoryConfigExtension.java   
@Override
public void postProcess(BeanDefinitionBuilder builder, AnnotationRepositoryConfigurationSource config) {

    AnnotationAttributes attributes = config.getAttributes();
    if (!attributes.getBoolean("multicoreSupport")) {
        builder.addPropertyReference("solrOperations", attributes.getString("solrTemplateRef"));
    } else {
        builder.addPropertyReference("solrServer", attributes.getString("solrServerRef"));
    }
    builder.addPropertyValue("schemaCreationSupport", attributes.getBoolean("schemaCreationSupport"));
}
项目:spring-data-keyvalue    文件:KeyValueRepositoryConfigurationExtension.java   
@Override
public void postProcess(BeanDefinitionBuilder builder, AnnotationRepositoryConfigurationSource config) {

    AnnotationAttributes attributes = config.getAttributes();

    builder.addPropertyReference("keyValueOperations", attributes.getString(KEY_VALUE_TEMPLATE_BEAN_REF_ATTRIBUTE));
    builder.addPropertyValue("queryCreator", getQueryCreatorType(config));
    builder.addPropertyValue("queryType", getQueryType(config));
    builder.addPropertyReference("mappingContext", getMappingContextBeanRef());
}
项目:spring-data-keyvalue    文件:KeyValueRepositoryConfigurationExtension.java   
/**
 * Detects the query creator type to be used for the factory to set. Will lookup a {@link QueryCreatorType} annotation
 * on the {@code @Enable}-annotation or use {@link SpelQueryCreator} if not found.
 *
 * @param config must not be {@literal null}.
 * @return
 */
private static Class<?> getQueryCreatorType(AnnotationRepositoryConfigurationSource config) {

    AnnotationMetadata metadata = config.getEnableAnnotationMetadata();

    Map<String, Object> queryCreatorAnnotationAttributes = metadata
            .getAnnotationAttributes(QueryCreatorType.class.getName());

    if (CollectionUtils.isEmpty(queryCreatorAnnotationAttributes)) {
        return SpelQueryCreator.class;
    }

    AnnotationAttributes queryCreatorAttributes = new AnnotationAttributes(queryCreatorAnnotationAttributes);
    return queryCreatorAttributes.getClass("value");
}
项目:spring-data-keyvalue    文件:KeyValueRepositoryConfigurationExtension.java   
/**
 * Detects the query creator type to be used for the factory to set. Will lookup a {@link QueryCreatorType} annotation
 * on the {@code @Enable}-annotation or use {@link SpelQueryCreator} if not found.
 *
 * @param config
 * @return
 */
private static Class<?> getQueryType(AnnotationRepositoryConfigurationSource config) {

    AnnotationMetadata metadata = config.getEnableAnnotationMetadata();

    Map<String, Object> queryCreatorAnnotationAttributes = metadata
            .getAnnotationAttributes(QueryCreatorType.class.getName());

    if (queryCreatorAnnotationAttributes == null) {
        return KeyValuePartTreeQuery.class;
    }

    AnnotationAttributes queryCreatorAttributes = new AnnotationAttributes(queryCreatorAnnotationAttributes);
    return queryCreatorAttributes.getClass("repositoryQueryType");
}
项目:spring-data-spanner    文件:SpannerRepositoryConfigurationExtension.java   
@Override
public void postProcess(BeanDefinitionBuilder builder, AnnotationRepositoryConfigurationSource config) {
  AnnotationAttributes attributes = config.getAttributes();

  builder.addPropertyReference("spannerOperations", attributes.getString("spannerTemplateRef"));
}
项目:spring-data-snowdrop    文件:SnowdropRepositoryConfigExtension.java   
@Override
public void postProcess(BeanDefinitionBuilder builder, AnnotationRepositoryConfigurationSource config) {
    AnnotationAttributes attributes = config.getAttributes();
    builder.addPropertyReference("datasourceMapper", attributes.getString("datasourceMapperRef"));
}
项目:lodsve-framework    文件:LodsveMongoRepositoryConfigurationExtension.java   
@Override
public void postProcess(BeanDefinitionBuilder builder, AnnotationRepositoryConfigurationSource config) {
    builder.addPropertyReference("mongoOperations", mongoTemplateId);
    builder.addPropertyValue("createIndexesForQueryMethods", false);
}
项目:spring-data-mybatis    文件:MybatisRepositoryConfigExtension.java   
@Override
public void postProcess(BeanDefinitionBuilder builder, AnnotationRepositoryConfigurationSource config) {
    AnnotationAttributes attributes = config.getAttributes();
    builder.addPropertyValue(ENABLE_DEFAULT_TRANSACTIONS_ATTRIBUTE, attributes.getBoolean(ENABLE_DEFAULT_TRANSACTIONS_ATTRIBUTE));
}
项目:spring-boot-starter-mybatis    文件:MyBatisRepositoryConfigExtension.java   
@Override
public void postProcess(final BeanDefinitionBuilder builder, final AnnotationRepositoryConfigurationSource config) {
    final AnnotationAttributes attributes = config.getAttributes();
    builder.addPropertyReference(SQL_SESSION_TEMPLATE, attributes.getString(SQL_SESSION_TEMPLATE_REF));
    builder.addPropertyValue(TRANSACTION_MANAGER, attributes.getString(TRANSACTION_MANAGER_REF));
}
项目:spring-boot-starter-mybatis    文件:MyBatisRepositoryConfigExtension.java   
@Override
public void postProcess(final BeanDefinitionBuilder builder, final AnnotationRepositoryConfigurationSource config) {
    final AnnotationAttributes attributes = config.getAttributes();
    builder.addPropertyReference(SQL_SESSION_TEMPLATE, attributes.getString(SQL_SESSION_TEMPLATE_REF));
    builder.addPropertyValue(TRANSACTION_MANAGER, attributes.getString(TRANSACTION_MANAGER_REF));
}
项目:spring-data-crate    文件:CrateRepositoryConfigExtension.java   
@Override
public void postProcess(BeanDefinitionBuilder builder, AnnotationRepositoryConfigurationSource config) {

    AnnotationAttributes attributes = config.getAttributes();
    builder.addPropertyReference("crateOperations", attributes.getString("crateTemplateRef"));
}
项目:spring-data-dynamodb    文件:DynamoDBRepositoryConfigExtension.java   
@Override
public void postProcess(BeanDefinitionBuilder builder, AnnotationRepositoryConfigurationSource config) {
    AnnotationAttributes attributes = config.getAttributes();

    postProcess(builder, attributes.getString("amazonDynamoDBRef"), attributes.getString("dynamoDBMapperConfigRef"),attributes.getString("dynamoDBOperationsRef"));

}
项目:spring-data-simpledb    文件:SimpleDbRepositoryConfigExtension.java   
/**
 * We bind here the provided SimpleDB template bean specified by "simpleDbTemplateRef" annotation property <br/>
 * to our internally used bean simpleDbOperations of class
 * {@link org.springframework.data.simpledb.repository.support.SimpleDbRepositoryFactoryBean}. <br/>
 * The bean will be used to construct repository implementations. <br/>
 */
@Override
public void postProcess(BeanDefinitionBuilder builder, AnnotationRepositoryConfigurationSource config) {
    AnnotationAttributes attributes = config.getAttributes();
       builder.addPropertyReference("simpleDbOperations", attributes.getString("simpleDbTemplateRef"));
}