Hi All,
I have a problem with the list being generated by the session.getNamedQuery(".......").list().
The results are totally different from the one that are being generated out of hibernate query shown in console(i enabled show_sql=true)
Here is the queryCode:
<query name="com.imedx.falcon.dao.DocumentDAO.getDocumentsForSubmittingAndFinalizing">
<![CDATA[
SELECT cdaDoc
FROM com.imedx.falcon.model.CDADocument cdaDoc, com.imedx.falcon.model.UserProfile up
WHERE cdaDoc.profileId = up.profileId
AND cdaDoc.uploadStatus = 0
AND cdaDoc.profileId > 0
ORDER BY cdaDoc.docId,up.roleTypeId
]]>
</query>
Calling Java code:Code:
cdaDocumentsList = session.getNamedQuery("com.imedx.falcon.dao.DocumentDAO.getDocumentsForSubmittingAndFinalizing")
.list();
Actual expected result: 5 different rows of CDADOc object but from list() method im getting 2 different objects being repeated 2 times and 3 times each.
Unable to figure out the main culprit.
Another interesting thing is:
I get accurate results when i try to get actual fields from the database rather than the row
i.e
Code:
SELECT cdaDoc.cdaObjectId, cdaDoc.docLocation, cdaDoc.docName, cdaDoc.voiceFileId,
cdaDoc.profileId,cdaDoc.interimDocName
FROM com.imedx.falcon.model.CDADocument cdaDoc, com.imedx.falcon.model.UserProfile up
WHERE cdaDoc.profileId = up.profileId
AND cdaDoc.uploadStatus = 0
AND cdaDoc.profileId > 0
ORDER BY cdaDoc.docId,up.roleTypeId
this works..but i want the whole row object