本文整理汇总了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;
}
示例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);
}
示例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);
}
示例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()
));
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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;
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}