本文整理汇总了Java中ma.glasnost.orika.MapperFactory类的典型用法代码示例。如果您正苦于以下问题:Java MapperFactory类的具体用法?Java MapperFactory怎么用?Java MapperFactory使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
MapperFactory类属于ma.glasnost.orika包,在下文中一共展示了MapperFactory类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: ModelRatingResultsDiagMapper
import ma.glasnost.orika.MapperFactory; //导入依赖的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();
}
示例2: ClaimMapper
import ma.glasnost.orika.MapperFactory; //导入依赖的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();
}
示例3: mapper
import ma.glasnost.orika.MapperFactory; //导入依赖的package包/类
@Bean
public Mapper mapper() {
MapperFactory mapperFactory = new DefaultMapperFactory.Builder().build();
mapperFactory.registerFilter(new OrikaHibernateFilter());
return new EditorMapper(mapperFactory.getMapperFacade());
}
示例4: configure
import ma.glasnost.orika.MapperFactory; //导入依赖的package包/类
/**
* This method configures the bean mapper.
*
* @param factory the mapper factory
*/
@Override
protected final void configure(final MapperFactory factory) {
factory
.classMap(TemplateExpression.class, TemplateExpressionDTO.class)
.byDefault()
.register();
factory
.classMap(TemplateMapping.class, TemplateMappingDTO.class)
.byDefault()
.register();
factory
.classMap(ActionRequestInstruction.class, ActionRequestInstructionDTO.class)
.byDefault()
.register();
}
示例5: MappingBuilder
import ma.glasnost.orika.MapperFactory; //导入依赖的package包/类
public MappingBuilder(MapperFactory mapperFactory, Type<?> sourceType, Type<?> destinationType, ApplicationContext applicationContext) {
this.sourceType = sourceType;
this.destinationType = destinationType;
this.mapperFactory = mapperFactory;
this.sourceClass = this.sourceType.getRawType();
this.destinationClass = this.destinationType.getRawType();
this.buildMapping();
this.buildConverts();
this.applicationContext = applicationContext;
}
示例6: map
import ma.glasnost.orika.MapperFactory; //导入依赖的package包/类
public static void map(MapperFactory mapper) {
mapper.classMap(UserInfo.class, User.class)
.mapNulls(false)
.byDefault()
.customize(new CustomMapper<UserInfo, User>() {
@Override
public void mapAtoB(UserInfo userInfo, User user, MappingContext context) {
user.displayName = String.format("%s %s", user.firstName, user.lastName);
}
})
.register();
mapper.classMap(Message.class, DialogMessage.class)
.field("body", "text")
.customize(new MessageCustomConverter())
.register();
}
示例7: configure
import ma.glasnost.orika.MapperFactory; //导入依赖的package包/类
@Override
protected final void configure(final MapperFactory factory) {
factory.getConverterFactory().registerConverter(new PassThroughConverter(ZonedDateTime.class));
factory.getConverterFactory().registerConverter(new BasicInfoConverter());
doConfigure(factory);
}
示例8: doConfigure
import ma.glasnost.orika.MapperFactory; //导入依赖的package包/类
@Override
protected void doConfigure(final MapperFactory factory) {
factory.getConverterFactory().registerConverter("optionalOrNull", new OptionalOrNullConverter<>());
factory.classMap(Scenario.class, ScenarioListItemView.class)
.byDefault()
.register();
factory.classMap(Scenario.class, FailedScenarioListItemView.class)
.byDefault()
.register();
factory.classMap(Scenario.class, ScenarioHistoryItemView.class)
.byDefault()
.register();
factory.classMap(Scenario.class, FailedScenarioListItemView.class)
.fieldMap("errorMessage").aToB().converter("optionalOrNull").add()
.byDefault()
.register();
}
示例9: configROMapper
import ma.glasnost.orika.MapperFactory; //导入依赖的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;
}
示例10: ModelRatingResultsMapper
import ma.glasnost.orika.MapperFactory; //导入依赖的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();
}
示例11: getObject
import ma.glasnost.orika.MapperFactory; //导入依赖的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();
}
示例12: configure
import ma.glasnost.orika.MapperFactory; //导入依赖的package包/类
/**
* Setup the mapper for all of our beans. Only fields having non identical names need mapping if we also use
* byDefault() following.
*
* @param factory the factory to which we add our mappings
*/
protected final void configure(final MapperFactory factory) {
factory.classMap(NotifyRequest.class, NotifyRequestForEmailDTO.class).byDefault().register();
factory.classMap(NotifyRequest.class, NotifyRequestForSMSDTO.class).byDefault().register();
factory.classMap(Response.class, ResponseDTO.class).byDefault().register();
}
示例13: configure
import ma.glasnost.orika.MapperFactory; //导入依赖的package包/类
/**
* This method configures the bean mapper.
*
* @param factory the mapper factory
*/
@Override
protected final void configure(final MapperFactory factory) {
factory
.classMap(Action.class, ActionDTO.class)
.field("actionType.name", "actionTypeName")
.byDefault()
.register();
factory
.classMap(ActionPlan.class, ActionPlanDTO.class)
.byDefault()
.register();
factory
.classMap(ActionPlanJob.class, ActionPlanJobDTO.class)
.byDefault()
.register();
factory
.classMap(ActionRule.class, ActionRuleDTO.class)
.field("actionType.name", "actionTypeName")
.byDefault()
.register();
}
示例14: configure
import ma.glasnost.orika.MapperFactory; //导入依赖的package包/类
/**
* Setup the mapper for all of our beans. Only fields having non identical names need
* mapping if we also use byDefault() following.
* @param factory the factory to which we add our mappings
*/
protected final void configure(final MapperFactory factory) {
factory
.classMap(ReportSummary.class, ReportSummaryDTO.class)
.byDefault()
.register();
factory
.classMap(ReportType.class, ReportTypeDTO.class)
.byDefault()
.register();
}
示例15: configure
import ma.glasnost.orika.MapperFactory; //导入依赖的package包/类
/**
* Setup the mapper for all of our beans. Only fields having non identical names need
* mapping if we also use byDefault() following.
* @param factory the factory to which we add our mappings
*/
protected final void configure(final MapperFactory factory) {
factory
.classMap(Case.class, CaseDTO.class)
.byDefault()
.register();
factory
.classMap(CaseGroup.class, CaseGroupDTO.class)
.byDefault()
.register();
factory
.classMap(CaseEvent.class, CaseEventDTO.class)
.byDefault()
.register();
factory
.classMap(Category.class, CategoryDTO.class)
.field("categoryType", "name")
.byDefault()
.register();
factory
.classMap(Response.class, ResponseDTO.class)
.byDefault()
.register();
}