new_nf wrote:
I have an SQL query and i want to convert it into a HQL query:
SELECT MESSAGES.MESSAGEID, MESSAGES.TYPE, MESSAGES.AREA, MESSAGES.FLOW, MESSAGES.OTHERFLOWINFO,
MESSAGES.DATECREATED, MESSAGES.DATELASTUPDATED, MESSAGES.CONTEXT, MESSAGES.STATUS, MESSAGES.PARENT,
PROBTRACKING.USERID
FROM MESSAGES
LEFT OUTER JOIN PROBTRACKING
ON MESSAGES.MESSAGEID = PROBTRACKING.MESSAGEID
AND PROBTRACKING.PROBLEMSTATUS = 'Unresolved'
Code:
from Messages m where m.probtracking.problemstatus='Unresolved'
Assuming messages<>probtracking is many-to-one.
Can you show the mappings?