I\'m performing a SQL query through hibernate, which looks like:
SELECT thi
FROM track_history_items thi
JOIN artists art
ON thi.artist_id = art.id
WHERE t
If you are using Hibernate 4 you should be calling:
Query query = session.getNamedQuery(Entity.NAMED_QUERY);
instead of
Query query = session.createQuery(Entity.NAMED_QUERY);
This happens because session.createQuery
will try to create the query based on the string value of Entity.NAMED_QUERY
for example:
String NAMED_QUERY = "Entity.namedQuery";
resulting in a incorrect HQL and raising a exception.