当前位置: 首页>>代码示例>>Java>>正文


Java CustomConversions类代码示例

本文整理汇总了Java中org.springframework.data.mongodb.core.convert.CustomConversions的典型用法代码示例。如果您正苦于以下问题:Java CustomConversions类的具体用法?Java CustomConversions怎么用?Java CustomConversions使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


CustomConversions类属于org.springframework.data.mongodb.core.convert包,在下文中一共展示了CustomConversions类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: mappingMongoConverter

import org.springframework.data.mongodb.core.convert.CustomConversions; //导入依赖的package包/类
@Bean
public MappingMongoConverter mappingMongoConverter(MongoDbFactory factory,
		MongoMappingContext context, BeanFactory beanFactory) {
	DbRefResolver dbRefResolver = new DefaultDbRefResolver(factory);
	MappingMongoConverter mappingConverter = new MappingMongoConverter(dbRefResolver,
			context);

	// remove _class field
	mappingConverter.setTypeMapper(new DefaultMongoTypeMapper(null));

	try {
		mappingConverter
				.setCustomConversions(beanFactory.getBean(CustomConversions.class));
	}
	catch (NoSuchBeanDefinitionException ex) {
		// Ignore
	}
	return mappingConverter;
}
 
开发者ID:ralscha,项目名称:eds-starter6-simple-mongodb,代码行数:20,代码来源:MongoConfig.java

示例2: mappingMongoConverter

import org.springframework.data.mongodb.core.convert.CustomConversions; //导入依赖的package包/类
@Bean
@ConditionalOnMissingBean(MongoConverter.class)
public MappingMongoConverter mappingMongoConverter(MongoDbFactory factory,
		MongoMappingContext context, BeanFactory beanFactory) {
	DbRefResolver dbRefResolver = new DefaultDbRefResolver(factory);
	MappingMongoConverter mappingConverter = new MappingMongoConverter(dbRefResolver,
			context);
	try {
		mappingConverter
				.setCustomConversions(beanFactory.getBean(CustomConversions.class));
	}
	catch (NoSuchBeanDefinitionException ex) {
		// Ignore
	}
	return mappingConverter;
}
 
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:17,代码来源:MongoDataAutoConfiguration.java

示例3: customConversions

import org.springframework.data.mongodb.core.convert.CustomConversions; //导入依赖的package包/类
@Bean
public CustomConversions customConversions() {
    List<Converter<?, ?>> converterList = new ArrayList<>();
    converterList.add(DateToZonedDateTimeConverter.INSTANCE);
    converterList.add(ZonedDateTimeToDateConverter.INSTANCE);
    return new CustomConversions(converterList);
}
 
开发者ID:oktadeveloper,项目名称:jhipster-microservices-example,代码行数:8,代码来源:CloudDatabaseConfiguration.java

示例4: customConversions

import org.springframework.data.mongodb.core.convert.CustomConversions; //导入依赖的package包/类
@Bean
public CustomConversions customConversions() {
    List<Converter<?, ?>> converters = new ArrayList<>();
    converters.add(DateToZonedDateTimeConverter.INSTANCE);
    converters.add(ZonedDateTimeToDateConverter.INSTANCE);
    return new CustomConversions(converters);
}
 
开发者ID:oktadeveloper,项目名称:jhipster-microservices-example,代码行数:8,代码来源:DatabaseConfiguration.java

示例5: customConversions

import org.springframework.data.mongodb.core.convert.CustomConversions; //导入依赖的package包/类
@Override
public CustomConversions customConversions() {
    return new CustomConversions(Arrays.asList(
            new BaseConverters.LoggerConverter(),
            new BaseConverters.ClassConverter(),
            new BaseConverters.CommonsLogConverter(),
            new BaseConverters.PersonAttributesConverter(),
            new BaseConverters.CacheLoaderConverter(),
            new BaseConverters.RunnableConverter(),
            new BaseConverters.ReferenceQueueConverter(),
            new BaseConverters.ThreadLocalConverter(),
            new BaseConverters.CertPathConverter(),
            new BaseConverters.CacheConverter()
    ));
}
 
开发者ID:mrluo735,项目名称:cas-5.1.0,代码行数:16,代码来源:MongoDbServiceRegistryConfiguration.java

示例6: customConversions

import org.springframework.data.mongodb.core.convert.CustomConversions; //导入依赖的package包/类
@Override
@Bean
public CustomConversions customConversions() {
    List<Converter<?, ?>> converterList = new ArrayList<>();
    AuthenticationReadConverter authenticationReadConverter = new AuthenticationReadConverter();
    converterList.add(authenticationReadConverter);
    return new CustomConversions(converterList);
}
 
开发者ID:BakkerTom,项目名称:happy-news,代码行数:9,代码来源:MongoConfig.java

示例7: customConversions

import org.springframework.data.mongodb.core.convert.CustomConversions; //导入依赖的package包/类
@Bean
public CustomConversions customConversions() {
    List<Converter<?, ?>> converterList = new ArrayList<>();;
    converterList.add(DateToZonedDateTimeConverter.INSTANCE);
    converterList.add(ZonedDateTimeToDateConverter.INSTANCE);
    converterList.add(DateToLocalDateConverter.INSTANCE);
    converterList.add(LocalDateToDateConverter.INSTANCE);
    converterList.add(DateToLocalDateTimeConverter.INSTANCE);
    converterList.add(LocalDateTimeToDateConverter.INSTANCE);
    return new CustomConversions(converterList);
}
 
开发者ID:RawSanj,项目名称:blogAggr,代码行数:12,代码来源:CloudMongoDbConfiguration.java

示例8: customConversions

import org.springframework.data.mongodb.core.convert.CustomConversions; //导入依赖的package包/类
@Bean
public CustomConversions customConversions() {
    List<Converter<?, ?>> converters = new ArrayList<>();
    converters.add(DateToZonedDateTimeConverter.INSTANCE);
    converters.add(ZonedDateTimeToDateConverter.INSTANCE);
    converters.add(DateToLocalDateConverter.INSTANCE);
    converters.add(LocalDateToDateConverter.INSTANCE);
    converters.add(DateToLocalDateTimeConverter.INSTANCE);
    converters.add(LocalDateTimeToDateConverter.INSTANCE);
    return new CustomConversions(converters);
}
 
开发者ID:RawSanj,项目名称:blogAggr,代码行数:12,代码来源:DatabaseConfiguration.java

示例9: customConversions

import org.springframework.data.mongodb.core.convert.CustomConversions; //导入依赖的package包/类
@Bean
public CustomConversions customConversions() {
    List<Converter<?, ?>> converters = new ArrayList<>();
    converters.add(JSR310DateConverters.DateToZonedDateTimeConverter.INSTANCE);
    converters.add(JSR310DateConverters.ZonedDateTimeToDateConverter.INSTANCE);
    converters.add(JSR310DateConverters.DateToLocalDateConverter.INSTANCE);
    converters.add(JSR310DateConverters.LocalDateToDateConverter.INSTANCE);
    converters.add(JSR310DateConverters.DateToLocalDateTimeConverter.INSTANCE);
    converters.add(JSR310DateConverters.LocalDateTimeToDateConverter.INSTANCE);
    return new CustomConversions(converters);
}
 
开发者ID:quanticc,项目名称:ugc-bot-redux,代码行数:12,代码来源:MongoConfiguration.java

示例10: getCustomerConversion

import org.springframework.data.mongodb.core.convert.CustomConversions; //导入依赖的package包/类
private CustomConversions getCustomerConversion() {
	List<Converter<?, ?>> converters = new ArrayList<Converter<?, ?>>();
	converters.add(new LocalDateReaderConverter());
	converters.add(new LocalDateWriterConverter());
	CustomConversions customConversion = new CustomConversions(converters);
	return customConversion;
}
 
开发者ID:ksambhav,项目名称:trueyes,代码行数:8,代码来源:AbstractMongoRepoConfiguration.java

示例11: customConversions

import org.springframework.data.mongodb.core.convert.CustomConversions; //导入依赖的package包/类
@Bean
public CustomConversions customConversions() {
    List<Converter<?, ?>> converterList = new ArrayList<>();;<% if (authenticationType == 'oauth2') { %>
    converterList.add(new OAuth2AuthenticationReadConverter());<% } %>
    converterList.add(DateToZonedDateTimeConverter.INSTANCE);
    converterList.add(ZonedDateTimeToDateConverter.INSTANCE);
    converterList.add(DateToLocalDateConverter.INSTANCE);
    converterList.add(LocalDateToDateConverter.INSTANCE);
    converterList.add(DateToLocalDateTimeConverter.INSTANCE);
    converterList.add(LocalDateTimeToDateConverter.INSTANCE);
    return new CustomConversions(converterList);
}
 
开发者ID:xetys,项目名称:jhipster-ribbon-hystrix,代码行数:13,代码来源:_CloudMongoDbConfiguration.java

示例12: customConversions

import org.springframework.data.mongodb.core.convert.CustomConversions; //导入依赖的package包/类
@Bean
public CustomConversions customConversions() {
    List<Converter<?, ?>> converters = new ArrayList<>();<% if (authenticationType == 'oauth2') { %>
    converters.add(new OAuth2AuthenticationReadConverter());<% } %>
    converters.add(DateToZonedDateTimeConverter.INSTANCE);
    converters.add(ZonedDateTimeToDateConverter.INSTANCE);
    converters.add(DateToLocalDateConverter.INSTANCE);
    converters.add(LocalDateToDateConverter.INSTANCE);
    converters.add(DateToLocalDateTimeConverter.INSTANCE);
    converters.add(LocalDateTimeToDateConverter.INSTANCE);
    return new CustomConversions(converters);
}
 
开发者ID:xetys,项目名称:jhipster-ribbon-hystrix,代码行数:13,代码来源:_DatabaseConfiguration.java

示例13: customConversions

import org.springframework.data.mongodb.core.convert.CustomConversions; //导入依赖的package包/类
@Bean
@Override
public CustomConversions customConversions() {
    List<Converter<?, ?>> converterList = new ArrayList<>();
    converterList.add(new LongToDateTimeConverter());
    converterList.add(new StringToDateTimeConverter());
    return new CustomConversions(converterList);
}
 
开发者ID:kbastani,项目名称:spring-cloud-event-sourcing-example,代码行数:9,代码来源:MongoConfiguration.java

示例14: customConversions

import org.springframework.data.mongodb.core.convert.CustomConversions; //导入依赖的package包/类
@Bean
public CustomConversions customConversions() {
    List<Converter<?, ?>> converterList = new ArrayList<>();
    converterList.add(DateToZonedDateTimeConverter.INSTANCE);
    converterList.add(ZonedDateTimeToDateConverter.INSTANCE);
    converterList.add(DateToLocalDateConverter.INSTANCE);
    converterList.add(LocalDateToDateConverter.INSTANCE);
    converterList.add(DateToLocalDateTimeConverter.INSTANCE);
    converterList.add(LocalDateTimeToDateConverter.INSTANCE);
    return new CustomConversions(converterList);
}
 
开发者ID:axel-halin,项目名称:Thesis-JHipster,代码行数:12,代码来源:CloudMongoDbConfiguration.java

示例15: customConversions

import org.springframework.data.mongodb.core.convert.CustomConversions; //导入依赖的package包/类
@Bean
public CustomConversions customConversions() {
    List<Converter<?, ?>> converterList = new ArrayList<>();<% if (authenticationType == 'oauth2') { %>
    converterList.add(new OAuth2AuthenticationReadConverter());<% } %>
    converterList.add(DateToZonedDateTimeConverter.INSTANCE);
    converterList.add(ZonedDateTimeToDateConverter.INSTANCE);
    converterList.add(DateToLocalDateConverter.INSTANCE);
    converterList.add(LocalDateToDateConverter.INSTANCE);
    converterList.add(DateToLocalDateTimeConverter.INSTANCE);
    converterList.add(LocalDateTimeToDateConverter.INSTANCE);
    return new CustomConversions(converterList);
}
 
开发者ID:axel-halin,项目名称:Thesis-JHipster,代码行数:13,代码来源:_CloudMongoDbConfiguration.java


注:本文中的org.springframework.data.mongodb.core.convert.CustomConversions类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。