當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。