I have a Class which has other objects as it's members fields. e.g.:
class Orders{
private Integer code;
@OneToOne(fetch=FetchType.EAGER)
@JoinColumn(name="code", nullable=false)
private Category category;
private PaymentType pt;
}
class Category{
private Integer id;
@OneToMany(fetch=FetchType.EAGER)
@JoinColumn(name="id", nullable=false)
private Brands brand;
....
}
class Brands{
private Integer id;
private String brandName;
}
I need to get all the Brands for that particular order.
How do I get just the brands through Orders table in Hql?