本文整理汇总了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();
}
示例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();
}
示例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());
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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());
}
示例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
}
示例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;
}
示例12: BaseMapper
import ma.glasnost.orika.impl.DefaultMapperFactory; //导入依赖的package包/类
protected BaseMapper()
{
mapperFactory = new DefaultMapperFactory.Builder().build();
}
示例13: ConversioTipusHelper
import ma.glasnost.orika.impl.DefaultMapperFactory; //导入依赖的package包/类
public ConversioTipusHelper() {
mapperFactory = new DefaultMapperFactory.Builder().build();
}
示例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();
}
示例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();
}