When I have the below query it will give me a list of Product.
List<Product>=
getCurrentSession().createQuery("SELECT p FROM Product p ").list();
What will it return when there is a join as below.
getCurrentSession().createQuery("SELECT p FROM Product p inner join ProductCategory pc where p.id=pc.id").list();
It should return List<Object[]>
as a result. Please see this thread
And you should access your entities like
for (Object[]> result : query.list()) {
Product p = (Product) result[0];
ProductCategory pc = (ProductCategory) result[1];
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With