• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java DefaultMapperFactory类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中ma.glasnost.orika.impl.DefaultMapperFactory的典型用法代码示例。如果您正苦于以下问题:Java DefaultMapperFactory类的具体用法?Java DefaultMapperFactory怎么用?Java DefaultMapperFactory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



DefaultMapperFactory类属于ma.glasnost.orika.impl包,在下文中一共展示了DefaultMapperFactory类的19个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: configure

import ma.glasnost.orika.impl.DefaultMapperFactory; //导入依赖的package包/类
@PostConstruct
private void configure() {
    mapperFactory = new DefaultMapperFactory.Builder().build();
    mapperFactory.classMap(ApplicationUser.class, UserDTO.class)
            .exclude("createdDate")
            .mapNulls(false)
            .mapNullsInReverse(false)
            .byDefault()
            .register();
    mapperFactory.classMap(UserSetting.class, UserSettingDTO.class)
            .field("user.id", "userId")
            .mapNulls(false)
            .mapNullsInReverse(false)
            .byDefault()
            .register();
}
 
开发者ID:SarunasDaubaris,项目名称:personal-garage-service,代码行数:17,代码来源:UserServiceModelMapper.java


示例2: buildFactory

import ma.glasnost.orika.impl.DefaultMapperFactory; //导入依赖的package包/类
/**
 * By using the ClassMapBuilder.byDefault(), we are relying on the automatic mapping of identically named fields (much as
 * you would get with BeanUtils.copyProperties()), as well as any nested classes. The service objects have core fields
 * that are the same as the DO object they represent as a base.
 * 
 * We then customize the class map to work with extended fields that don't fit the simple model. Because of this, mapper
 * classes are not needed for all of our objects. Some are fulfilled by the base mapping provided by orika. Orika handles
 * any two classes thrown at it, mapping what it can.
 */
private void buildFactory() {

	// Use for troubleshooting. This will make Orika write the generated mapping
	// file out to the filesystem.
	// System.setProperty(OrikaSystemProperties.WRITE_SOURCE_FILES,"true");
	// System.setProperty(OrikaSystemProperties.WRITE_CLASS_FILES,"true");

	factory = new DefaultMapperFactory.Builder().build();

	factory.classMap(ContactDO.class, Contact.class).byDefault().customize(new ContactDOandContactMapper()).register();
	factory.classMap(OrgDO.class, Org.class).byDefault().customize(new OrgDOandOrgMapper()).register();
	factory.classMap(ScopeDO.class, Scope.class).byDefault().customize(new ScopeDOandScopeMapper()).register();
	factory.classMap(UserDO.class, User.class).byDefault().customize(new UserDOandUserMapper()).register();
	factory.classMap(DeviceDO.class, Device.class).byDefault().customize(new DeviceDOandDeviceMapper()).register();
	factory.classMap(FileDO.class, File.class).byDefault().customize(new FileDOandFileMapper()).register();
	factory.classMap(UserRoleDO.class, UserRole.class).byDefault().customize(new UserRoleDOtoUserRoleMapper())
			.register();
	factory.classMap(UserOrgDO.class, UserOrg.class).byDefault().customize(new UserOrgDOToUserOrgMapper()).register();
}
 
开发者ID:SmarterApp,项目名称:TechnologyReadinessTool,代码行数:29,代码来源:MappingServiceImpl.java


示例3: init

import ma.glasnost.orika.impl.DefaultMapperFactory; //导入依赖的package包/类
@Programmatic
@PostConstruct
public void init() {
    mapperFactory = new DefaultMapperFactory.Builder().build();
    mapperFactory.registerClassMap(
            mapperFactory.classMap(QuickObject.class, QuickObjectDto.class)
                    .byDefault() // all fields are the compatible
                    .toClassMap());
    mapperFactory.registerClassMap(
            mapperFactory.classMap(Bookmark.class, OidDto.class)
                    .field("identifier", "objectIdentifier") // customized
                    .byDefault() // all other fields are compatible
                    .toClassMap());
}
 
开发者ID:isisaddons-legacy,项目名称:isis-app-quickstart,代码行数:15,代码来源:DomainAppContentMappingService.java


示例4: ModelRatingResultsDiagMapper

import ma.glasnost.orika.impl.DefaultMapperFactory; //导入依赖的package包/类
public ModelRatingResultsDiagMapper() {
    MapperFactory mapperFactory = new DefaultMapperFactory.Builder().build();
    
    mapperFactory.classMap(gov.va.vba.persistence.entity.ModelRatingResultsDiag.class, ModelRatingResultsDiag.class)
      .field("id.diagId", "diagId")
      .field("modelRatingResults.processId", "processId")
      .field("count", "count")
      .register();
    
    mapperFacade = mapperFactory.getMapperFacade();
}
 
开发者ID:VHAINNOVATIONS,项目名称:BCDS,代码行数:12,代码来源:ModelRatingResultsDiagMapper.java


示例5: ClaimMapper

import ma.glasnost.orika.impl.DefaultMapperFactory; //导入依赖的package包/类
public ClaimMapper() {
    MapperFactory mapperFactory = new DefaultMapperFactory.Builder().build();
    mapperFactory.classMap(gov.va.vba.persistence.entity.Veteran.class, Veteran.class)
            .field("veteranId", "veteranId")
            .register();
    mapperFactory.classMap(gov.va.vba.persistence.entity.Claim.class, Claim.class)
            .field("claimDate", "claimDate")
            .field("claimId", "claimId")
            .field("veteran.veteranId", "veteran.veteranId")
            .field("regionalOfficeOfClaim", "regionalOfficeOfClaim")
            .field("contentionId", "contentionId")
            .field("contentionClaimTextKeyForModel", "contentionClaimTextKeyForModel")
            .register();
    mapperFacade = mapperFactory.getMapperFacade();

}
 
开发者ID:VHAINNOVATIONS,项目名称:BCDS,代码行数:17,代码来源:ClaimMapper.java


示例6: BlogMapperFactory

import ma.glasnost.orika.impl.DefaultMapperFactory; //导入依赖的package包/类
public BlogMapperFactory() {
	mapperFactory = new DefaultMapperFactory.Builder()
			.compilerStrategy(new ExtendedJavaassistCompilerStrategy()).build();
	
	registerBaseMapper();
	registerBlogMapper();
	registerCategoryMapper();
	registerKeywordMapper();
	registerPaginationMapper();
	registerPaginationQueryMapper();
	registerPostMapper();
	registerUserMapper();
}
 
开发者ID:daflockinger,项目名称:spongeblog,代码行数:14,代码来源:BlogMapperFactory.java


示例7: configure

import ma.glasnost.orika.impl.DefaultMapperFactory; //导入依赖的package包/类
@PostConstruct
public void configure() {
    mapperFactory = new DefaultMapperFactory.Builder().build();
    mapperFactory.classMap(Car.class, CarDTO.class)
            .field("user.id", "userId")
            .exclude("createdDate")
            .mapNulls(false)
            .mapNullsInReverse(false)
            .byDefault()
            .register();
}
 
开发者ID:SarunasDaubaris,项目名称:personal-garage-service,代码行数:12,代码来源:CarServiceModelMapper.java


示例8: configure

import ma.glasnost.orika.impl.DefaultMapperFactory; //导入依赖的package包/类
@PostConstruct
public void configure() {
    mapperFactory = new DefaultMapperFactory.Builder().build();
    mapperFactory.classMap(Transaction.class, TransactionDTO.class)
            .field("user.id", "userId")
            .field("car.id", "carId")
            .exclude("createdDate")
            .mapNulls(false)
            .mapNullsInReverse(false)
            .byDefault()
            .register();
}
 
开发者ID:SarunasDaubaris,项目名称:personal-garage-service,代码行数:13,代码来源:TransactionServiceModelMapper.java


示例9: mapper

import ma.glasnost.orika.impl.DefaultMapperFactory; //导入依赖的package包/类
@Bean
public Mapper mapper() {
  MapperFactory mapperFactory = new DefaultMapperFactory.Builder().build();
  mapperFactory.registerFilter(new OrikaHibernateFilter());

  return new EditorMapper(mapperFactory.getMapperFacade());
}
 
开发者ID:empt-ak,项目名称:meditor,代码行数:8,代码来源:EditorConfiguration.java


示例10: setUp

import ma.glasnost.orika.impl.DefaultMapperFactory; //导入依赖的package包/类
@BeforeMethod
public void setUp() {
	// CDI: @Autowired, @Inject, etc.
	objectUnderTest = new TestOrikaModelTransformer(
			new TestReflectionModelTransformerFactory(
					singleton(new TestOrikaModelTransformerProvider(
							new DefaultMapperFactory.Builder().build()))));
	objectUnderTest.buildReflectionModelTransformers(); // CDI: @PostConstruct
}
 
开发者ID:InterstellarOcean,项目名称:terraforming,代码行数:10,代码来源:TestOrikaModelTransformerTest.java


示例11: configROMapper

import ma.glasnost.orika.impl.DefaultMapperFactory; //导入依赖的package包/类
@Bean(name = "dockerJavaMapper")
    public MapperFactory configROMapper() {
        MapperFactory mapperFactory = new DefaultMapperFactory.Builder().build();

        initCustom(mapperFactory);

//        mapperFactory.getConverterFactory().registerConverter(new LocalDateConverter());
//        mapperFactory.getConverterFactory().registerConverter(new LocalDatetimeConverter());
        mapperFactory.getConverterFactory().registerConverter(new PassThroughConverter(LocalDate.class));
        mapperFactory.getConverterFactory().registerConverter(new PassThroughConverter(LocalDateTime.class));
        mapperFactory.getConverterFactory().registerConverter(new PassThroughConverter(BigDecimal.class));

        return mapperFactory;
    }
 
开发者ID:petrleocompel,项目名称:docker-dash,代码行数:15,代码来源:MapperConfiguration.java


示例12: BaseMapper

import ma.glasnost.orika.impl.DefaultMapperFactory; //导入依赖的package包/类
protected BaseMapper()
{
    mapperFactory = new DefaultMapperFactory.Builder().build();
}
 
开发者ID:wenhao,项目名称:ci-hands-on,代码行数:5,代码来源:BaseMapper.java


示例13: ConversioTipusHelper

import ma.glasnost.orika.impl.DefaultMapperFactory; //导入依赖的package包/类
public ConversioTipusHelper() {
	mapperFactory = new DefaultMapperFactory.Builder().build();
}
 
开发者ID:GovernIB,项目名称:helium,代码行数:4,代码来源:ConversioTipusHelper.java


示例14: ModelRatingResultsMapper

import ma.glasnost.orika.impl.DefaultMapperFactory; //导入依赖的package包/类
public ModelRatingResultsMapper() {
    MapperFactory mapperFactory = new DefaultMapperFactory.Builder().build();
    
    mapperFactory.classMap(gov.va.vba.persistence.entity.Veteran.class, Veteran.class)
            .field("veteranId", "veteranId")
            .register();
    mapperFactory.classMap(gov.va.vba.persistence.entity.DDMModelPatternIndex.class, ModelPatternIndex.class)
    		.field("patternId", "patternId")
    		.register();
    mapperFactory.classMap(gov.va.vba.persistence.entity.ModelRatingResults.class, ModelRatingResults.class)
      .field("processId", "processId")
      .field("veteran.veteranId", "veteran.veteranId")
      .field("patternIndex.patternId", "patternIndex.patternId")
      .field("patternIndex.accuracy", "patternIndex.accuracy")
      .field("patternIndex.patternIndexNumber", "patternIndex.patternIndexNumber")
      .field("patternIndex.CDD", "patternIndex.CDD")
      .field("patternIndex.modelType", "patternIndex.modelType")
      .field("claimId", "claimId")
      .field("claimDate", "claimDate")
      .field("claimAge", "claimAge")
      .field("modelType", "modelType")
      .field("priorCDD", "priorCDD")
      .field("quantPriorCDD", "quantPriorCDD")
      .field("currentCDD", "currentCDD")
      .field("quantCDD", "quantCDD")
      .field("processDate", "processDate")
      .field("CDDAge", "CDDAge")
      .field("claimCount", "claimCount")
      .field("claim.contentionClaimTextKeyForModel", "claim.contentionClaimTextKeyForModel")
      .byDefault()
            .register();
    mapperFactory.classMap(gov.va.vba.persistence.entity.ModelRatingResultsStatus.class, ModelRatingResultsStatus.class)
      .field("id.processId", "processId")
      .field("id.processStatus", "processStatus")
      .field("crtdBy", "createdBy")
.register();
    mapperFactory.classMap(gov.va.vba.persistence.entity.DDMModelPatternIndex.class, ModelRatingPattern.class)
      .field("patternId", "patternIndex.patternId")
      .field("accuracy", "patternIndex.accuracy")
      .field("patternIndexNumber", "patternIndex.patternIndexNumber")
      .field("CDD", "patternIndex.CDD")
      .field("modelType", "patternIndex.modelType")
      .field("categoryId", "categoryId")
      .field("createdDate", "createdDate")
      .field("createdBy", "createdBy")
.register();
    
    mapperFacade = mapperFactory.getMapperFacade();
    
}
 
开发者ID:VHAINNOVATIONS,项目名称:BCDS,代码行数:51,代码来源:ModelRatingResultsMapper.java


示例15: getObject

import ma.glasnost.orika.impl.DefaultMapperFactory; //导入依赖的package包/类
public MapperFacade getObject() throws Exception {

        MapperFactory mapperFactory = new DefaultMapperFactory.Builder()
                .classMapBuilderFactory(new AnnotationClassMapBuilder.Factory())
                .build();
        mapperFactory.getConverterFactory().registerConverter(new PassThroughConverter(org.joda.time.DateTime.class));

//        mapperFactory.registerClassMap(
//                mapperFactory.classMap(ComplexCriterion.class, gov.va.vba.persistence.entity.ComplexCriterion.class)
//                        .field("criteria", "simpleCriteria")
//                        .byDefault()
//                        .toClassMap()
//        );

        return mapperFactory.getMapperFacade();
    }
 
开发者ID:VHAINNOVATIONS,项目名称:BCDS,代码行数:17,代码来源:MapperFacadeFactory.java


示例16: configureFactoryBuilder

import ma.glasnost.orika.impl.DefaultMapperFactory; //导入依赖的package包/类
@Override
public void configureFactoryBuilder(DefaultMapperFactory.Builder builder) {
  builder.compilerStrategy(new EclipseJdtCompilerStrategy());
}
 
开发者ID:ONSdigital,项目名称:response-management-service,代码行数:5,代码来源:ActionBeanMapper.java


示例17: beanMapper

import ma.glasnost.orika.impl.DefaultMapperFactory; //导入依赖的package包/类
@Bean
MapperFacade beanMapper() {
  return new DefaultMapperFactory.Builder().build().getMapperFacade();
}
 
开发者ID:adrobisch,项目名称:putput,代码行数:5,代码来源:DozerConfiguration.java


示例18: convertObjectToMap

import ma.glasnost.orika.impl.DefaultMapperFactory; //导入依赖的package包/类
/**
 * Convert an object to a Map
 *
 * @param object object to convert
 * @return Map<String, Object> converted object
 */
protected Map<String, Object> convertObjectToMap(Object object) {
  Type objectType = TypeFactory.valueOf(object.getClass());
  Type mapType = new TypeBuilder<Map<String, Object>>() {
  }.build();

  MapperFactory mapperFactory = new DefaultMapperFactory.Builder().build();
  mapperFactory.classMap(objectType, mapType).byDefault().register();
  BoundMapperFacade boundMapper = mapperFactory.getMapperFacade(objectType, mapType);
  Map<String, Object> convertedObject = (Map<String, Object>) boundMapper.map(object);

  return convertedObject;
}
 
开发者ID:benjamin-cartereau,项目名称:w4-bpmnplus-module-jms,代码行数:19,代码来源:AbstractW4MessageListener.java


示例19: clonerConverter

import ma.glasnost.orika.impl.DefaultMapperFactory; //导入依赖的package包/类
@Test
public void clonerConverter() throws DatatypeConfigurationException {

    ClonerConverter cc2 = new ClonerConverter(DeepCopyHolder.class);

    MapperFactory factory = new DefaultMapperFactory.Builder().build();
    factory.getConverterFactory().registerConverter(cc2);

    GregorianCalendar cal = new GregorianCalendar();
    cal.add(Calendar.YEAR, 10);
    XMLGregorianCalendar xmlCal = DatatypeFactory.newInstance().newXMLGregorianCalendar((GregorianCalendar) cal);
    cal.add(Calendar.MONTH, 3);

    DeepCopyHolder source = new DeepCopyHolder();
    source.value = new IdHolder();
    source.value.setId("A Sample Value to Copy");
    source.timestamp = new Timestamp(System.currentTimeMillis() + 10000000);
    source.calendar = cal;
    source.xmlCalendar = xmlCal;

    DeepCopyHolder dest = factory.getMapperFacade().map(source, DeepCopyHolder.class);

    Assert.assertEquals(source.value, dest.value);
    Assert.assertNotSame(source.value, dest.value);
    Assert.assertEquals(source.timestamp, dest.timestamp);
    Assert.assertNotSame(source.timestamp, dest.timestamp);
    Assert.assertEquals(source.calendar, dest.calendar);
    Assert.assertNotSame(source.calendar, dest.calendar);
    Assert.assertEquals(source.xmlCalendar, dest.xmlCalendar);
    Assert.assertNotSame(source.xmlCalendar, dest.xmlCalendar);
}
 
开发者ID:JadiraOrg,项目名称:jadira,代码行数:32,代码来源:ClonerConverterTest.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java KSMetaData类代码示例发布时间:2022-05-21
下一篇:
Java ChartChangeListener类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap