Hibernate selecting all rows of a table (using .* ) join with multiple tables, giving Exception

hibernate, join

Solution

you don't need the "*". hibernate is turning objects , * is meaningless as its for pointing the columns in SQL. When you want the E , it turns the E object.

SELECT E FROM E

this is the HQL for `SELECT * FROM E`

even "FROM E" works , when you're calling session.createQuery() .

Problem

Is possible with Hibernate do this? ``` select A.something, B.something, C.something, D.something , E.* from A LEFT OUTER JOIN B on A.id = B.id_fk LEFT OUTER JOIN C ON B.id = C.id_fk LEFT OUTER JOIN D ON C.id = D.id_fk LEFT OUTER JOIN E ON A.abc = E.abc; ``` This query works fine in SQL but gives below Exception in Hibernate: ``` org.hibernate.hql.ast.QuerySyntaxException: expecting IDENT, found '*' near line 1 ```

Original source