Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to get data from 2 column of table through select

 
omkar prem
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic