• Post Reply Bookmark Topic Watch Topic
  • New Topic

Multiple Columns Retrival in JPA

 
Rithanya Laxmi
Ranch Hand
Posts: 190
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have a requiremnement where I need to retrieve multiple columns from the table "User" using JPQL? Like:-


select user.userName, user.password from User user where userId=?

How to do that using JPQL in java , whether multiple columns retrival result in single "User" object or Object[]? Please clarify with example.

Thanks.
 
Gravity is a harsh mistress. But this tiny ad is pretty easy to deal with:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!