I have an entity like this (any unnecessary code omitted):
class Client{
private id;
@OneToMany(mappedBy = "client", fetch = FetchType.EAGER)
private Set<Remark> remarks = new HashSet<Remark>();
//getters and setters
}
I call List clients = session.createCriteria(Client.class). If Client has multiple remarks, I get multiple the same Client objects, for example if Client has 2 remarks, then in list there are two the same clients. I don't think this is good behaviour, am I missing something?