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
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() .
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