after mapping i have a Entitytwo.id = null knowing thats it present on The BDTO .Other field are mapped correctly not included in entity code and they are mapped automatically this only for this associated field object I have the entity like :
public class EntityOne implements Serializable {
private BigDecimal id;
private EntityTwo entityTwo;
}
and Entity1BDTO :
public class EntityOneBDTO implements Serializable {
private BigDecimal id;
private BigDecimal entityTwo; // Its EntityTwo.id
}
My mapper Class :
public class EntityOneBDTO ToEntityOne extends PropertyMap<EntityOneBDTO , EntityOne >{
@Override
protected void configure() {
map().setId(source.getId());
map().getEntityTwo().setId(source.getEntityTwo());
skip().setgetEntityTwo(null); // to skip other field of object
it returns with the error
1) Failed to set value '1' on model.EntityOne.setEntityTwo() // i want to set it to EntityOne.EntityTwo.id
Thank you in advance