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(); } }; }
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); }
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(); } }; }
@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"); }
@Override public void postProcess(BeanDefinitionBuilder builder, AnnotationRepositoryConfigurationSource config) { AnnotationAttributes attributes = config.getAttributes(); builder.addPropertyValue(ENABLE_DEFAULT_TRANSACTIONS_ATTRIBUTE, attributes.getBoolean(ENABLE_DEFAULT_TRANSACTIONS_ATTRIBUTE)); }
@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")); }
@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()); }
/** * 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"); }
/** * 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"); }
@Override public void postProcess(BeanDefinitionBuilder builder, AnnotationRepositoryConfigurationSource config) { AnnotationAttributes attributes = config.getAttributes(); builder.addPropertyReference("spannerOperations", attributes.getString("spannerTemplateRef")); }
@Override public void postProcess(BeanDefinitionBuilder builder, AnnotationRepositoryConfigurationSource config) { AnnotationAttributes attributes = config.getAttributes(); builder.addPropertyReference("datasourceMapper", attributes.getString("datasourceMapperRef")); }
@Override public void postProcess(BeanDefinitionBuilder builder, AnnotationRepositoryConfigurationSource config) { builder.addPropertyReference("mongoOperations", mongoTemplateId); builder.addPropertyValue("createIndexesForQueryMethods", false); }
@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)); }
@Override public void postProcess(BeanDefinitionBuilder builder, AnnotationRepositoryConfigurationSource config) { AnnotationAttributes attributes = config.getAttributes(); builder.addPropertyReference("crateOperations", attributes.getString("crateTemplateRef")); }
@Override public void postProcess(BeanDefinitionBuilder builder, AnnotationRepositoryConfigurationSource config) { AnnotationAttributes attributes = config.getAttributes(); postProcess(builder, attributes.getString("amazonDynamoDBRef"), attributes.getString("dynamoDBMapperConfigRef"),attributes.getString("dynamoDBOperationsRef")); }
/** * 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")); }