我有以下课程。
// Source Classes
class SourceEmployer
{
private EmployerDetail employerDetail;
// getters/setters
}
class EmployerDetail
{
private String name;
// getters/setters
}
// Destination Classes
class DestApplication
{
private Employment employment;
// getters/setters
}
class Employment
{
private Set<EmployerDetails> employerDetails;
// getters/setters
}
class EmployerDetails
{
private String employerName;
// getters/setters
}
// Some Mapping configuration
public DestApplication getOrikaMapping(SourceEmployer source, DestApplication destination)
{
MapperFacade mapper;
MapperFactory mapperFactory = new DefaultMapperFactory.Builder().build();
mapperFactory.classMap(source.getClass(), destination.getClass())
.field("employerDetail.name",
"employment.employerDetails{employerName}")
.byDefault()
.register();
mapper = mapperFactory.getMapperFacade();
DestApplication dto = mapper.map(source, DestApplication.class);
return dto;
}
执行上述代码时,我遇到了以下异常...
-------------------------------------------------- ------------ Unenhance strategy: ma.glasnost.orika.unenhance.BaseUnenhancer@3547efb7 -----结束当前状态的转储--------------- ---------------- 在 ma.glasnost.orika.impl.ExceptionUtility.newMappingException(ExceptionUtility.java:55) 测试 au.com.copl.dbaccesslayer.session.WebserviceBeanTest 失败