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


Java DefaultMapperFactory类代码示例

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


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


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