• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Fetching list of single column

 
Jayavardhan geepi
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

gives me List<Emp>.
But, If I need List<String> (where each entry is empid) using same query , what should I do? Please help.
 
Kunal Lakhani
Ranch Hand
Posts: 622
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you are aware of Criteria, you can use projections.
 
Jayavardhan geepi
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I came across addScalar("empid", Hibernate.String) which works as expected
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic