Hi there,
I have a scenario where in I have to map an integer value from a DTO class to a @ManyToOne member of an Entity class.
i.e
DTO.java
{
private int id;
//GETTER & SETTER
}
Entity.java
{
private User user;
@ManyToOne(fetch = FetchType.EAGER)
@JoinColumn (name ="user", referencedColumnName="userId")
public Users getUser() {
return user;
}
}
User.java
{
private int userId;
//Getter and Setter
}
dozer-mapping.xml
<mapping map-null="false" map-empty-string="false">
<class-a>DTO</class-a>
<class-b>Entity</class-b>
<field>
<a>id</a>
<b>userId</b>
</field>
</mapping>
Kindly help me with this mapping. Thanks in advance