In my project I have an entity with this property:
/**
* @return the myObject
*/
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "T1_MYOBJECT")
public MyObject getMyObject()
{
return myObject;
}
When I call method getMyObject() to assign that value to a new object, a query is made on the db to retrieve it. How can I avoid that query? I only want to assign its value to a new object.