Java源码示例:org.springframework.data.repository.config.AnnotationRepositoryConfigurationSource

示例1
@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");
}
 
示例2
@Override
public void postProcess(BeanDefinitionBuilder builder,
		AnnotationRepositoryConfigurationSource config) {
	AnnotationAttributes attributes = config.getAttributes();

	builder.addPropertyReference("datastoreTemplate",
			attributes.getString("datastoreTemplateRef"));
	builder.addPropertyReference("datastoreMappingContext",
			attributes.getString("datastoreMappingContextRef"));

}
 
示例3
@Override
public void postProcess(BeanDefinitionBuilder builder,
		AnnotationRepositoryConfigurationSource config) {
	AnnotationAttributes attributes = config.getAttributes();

	builder.addPropertyReference("spannerTemplate",
			attributes.getString("spannerTemplateRef"));
	builder.addPropertyReference("spannerMappingContext",
			attributes.getString("spannerMappingContextRef"));

}
 
示例4
@Override
public void postProcess(BeanDefinitionBuilder builder,
		AnnotationRepositoryConfigurationSource config) {
	AnnotationAttributes attributes = config.getAttributes();

	builder.addPropertyReference("firestoreTemplate",
			attributes.getString("firestoreTemplateRef"));
	builder.addPropertyReference("firestoreMappingContext",
			attributes.getString("firestoreMappingContextRef"));
}
 
示例5
@Override
public void postProcess(BeanDefinitionBuilder builder,
		AnnotationRepositoryConfigurationSource config) {

	AnnotationAttributes attributes = config.getAttributes();
	builder.addPropertyValue(ENABLE_DEFAULT_TRANSACTIONS_ATTRIBUTE,
			attributes.getBoolean(ENABLE_DEFAULT_TRANSACTIONS_ATTRIBUTE));

}
 
示例6
@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());
}
 
示例7
/**
 * 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");
}
 
示例8
/**
 * 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");
}
 
示例9
@Override
public void postProcess(BeanDefinitionBuilder builder, AnnotationRepositoryConfigurationSource config) {

	AnnotationAttributes attributes = config.getAttributes();
	builder.addPropertyReference("crateOperations", attributes.getString("crateTemplateRef"));
}
 
示例10
@Override
public void postProcess(BeanDefinitionBuilder builder, AnnotationRepositoryConfigurationSource config) {
	AnnotationAttributes attributes = config.getAttributes();

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

}
 
示例11
/**
 * 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"));
}