I am using hibernate for database communication. I have one class as:
@Table(name="Person")
public class Person {
@Column(name="name")
private String name;
@OneToMany
@JoinColumn(name="Address_id)
private Set<Address> address;
... <other filed similarly>
}
Now I want to get this object using its primary key , but object should have only specific columns populate?
I tried using criteria and projection, it is returning a result but it is not mapped to Object i expect (Person Object)
Any idea how to solve this problem using hibernate query/criteria?
Thanks