This week's book giveaway is in the Mac OS forum. We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line! See this thread for details.
The reason is u.name is a String. You are no longer getting a User1 object from the query. If you still want to work with User1 objects then you need to use transformation as shown in the example below.
- Hope this helps.
Joined: Apr 04, 2008
Thankyou very much. The program is working.
It works fine if querying from a single table.
How can I write the query to retreive from more than one table(may be 2 or 3) and with parameters? For Example if my query is
session.createQuery("select a.name , b.dept from User as a,department as b where a.DEPT_ID = b.DEPT_ID and a.NAME like ?").setString(0,userName).list();