Map your REP_LOG table to a class called REP_LOG. Make sure the class has properties called RL_ID and USER_ID and map them to this columns.
This way your HQL looks exactly like the SQL.
The big difference is, that the SQL (called via JDBC) gets you a resultset, everything else you have to do yourself (read it, take some actions, create new SQLs and so on).
With Hibernate and HQL you get Java objects. You can change them, create new ones (Sessin.save) delete them (Session.delete) and Hibernate does the rest (all the JDBC stuff) for you.
HTH
Ernst
|