本文整理匯總了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);
}