aspose file tools*
The moose likes Object Relational Mapping and the fly likes How to get data from 2 column of table through select Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "How to get data from 2 column of table through select" Watch "How to get data from 2 column of table through select" New topic
Author

How to get data from 2 column of table through select

omkar prem
Greenhorn

Joined: Dec 17, 2006
Posts: 8
Hi All,

I have to get data from two column of table. My table name is Employee_Det the fields in the table are ID,Name,Age,Deg. the query i am using to fetch ID and Name are as followes

Query qr = session.createSQLquery("select e.id,e.name from Employee_det as e").addEntity("e",empl.class)

but this query gives an error. I have to do this by using addEntity() method



Prem
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: How to get data from 2 column of table through select
 
Similar Threads
Please HELP with Hibernate Mapping!
how to get data from alias
Hibernate: Problem with subset query
Hibernate native sql problem
mapping one pojo with multiple tables