Iam working on web spring + hibernate project I have a problem in my loading set
I have a java class Entity
@Entity
public class Product
{
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private int id;
@ManyToMany(cascade= CascadeType.ALL)
@JoinTable(
joinColumns = @JoinColumn( name="parent_id"),
inverseJoinColumns = @JoinColumn( name="id"))
private Set<Product> gifts;
@ManyToMany(cascade= CascadeType.ALL)
@JoinTable(
joinColumns = @JoinColumn( name="parent_id"),
inverseJoinColumns = @JoinColumn( name="id"))
private Set<Product> suggestion;
@ManyToMany(cascade= CascadeType.ALL)
@JoinTable(
joinColumns = @JoinColumn( name="parent_id"),
inverseJoinColumns = @JoinColumn( name="id"))
Private Set<Product> relative;
}
gifts,suggestion and relative set are fetch = lazy and i dont want to eager
Now I want to Load gifts,suggestion and relative product in one statement hibernate query
whats the best suggest for my idea
i can not change source code i want to find way to load set objects when load product