Hello,
Consider this task:
"select category from database for which are products ordered by type name and category name"
Products ( id, name, price, category )
Category ( id, name, type )
Type ( id, name )
Type one-many Category
Category one-many Product
Ok so, I use HQL like:
select distinct category from Product product join fetch product.category category join fetch category.type order by category.typ.name, category.name.
and ... we have problem with multijoin with fetch
Hibernate make good query to database, but it can't fetch object from result because he use different alias in 'making query' and in 'fetching'.
or somethings ...
It throw exception:
org.hibernate.exception.GenericJDBCException: could not execute query
..
..
Caused by: org.postgresql.util.PSQLException: The column name id4_1_ not found.
Greetings
Flower
|