I Have this classes:
@Entity
public class Category {
private Long Id;
private String name;
private String description;
private List<Product> products;
}
@Entity
public class Inventory {
private Long id;
private Product product;
private int quantity;
}
@Entity
public class Product {
private Long productId;
private String name;
}
I want to get the Inventory given the id in the category. i'm trying to use this
return session.createQuery("select i from Inventory i, Category c join c.Products p outer join i.product = p WHERE c.Id=?")
.setParameter(0, categoryId).list();
I'm really confused, please help. Thanks.