File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Object Relational Mapping and the fly likes converting sql query to hql Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "converting sql query to hql" Watch "converting sql query to hql" New topic
Author

converting sql query to hql

Steven Adams
Greenhorn

Joined: Feb 05, 2009
Posts: 1
Hi,
I'd like to convert the following query to hql...
Anyone knows?
It's pretty complicated!
Thanks,
Steve

SELECT DISTINCT
a.*
, NVL(b.COL1, 0) AS WORKING
, NVL(c.COL2, 0) AS RECRUITED
, NVL(d.COL3, 0) AS FIRED
FROM PM_CATEGORY a
LEFT OUTER JOIN (SELECT CATEGORY_ID,
COUNT(*) OVER (PARTITION BY CATEGORY_ID, TRE_NODE_ID3) AS COL1
FROM EM_EMPL_FILE
WHERE TRE_NODE_ID3 = 1
) b ON a.ID = b.CATEGORY_ID
ORDER BY 1
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: converting sql query to hql
 
Similar Threads
How to handl Null Values from Database
String funciton in oracle database
Regular expression - Pattern and matcher
Prb in compiling the JSP
Need help - Lot of joins are slowing down my query