Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hibernate Query with AND condition

 
Rohit Kumar
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

New to Hiebrnate..


I have normal sql query like...

select * from emplyee where emp_id='1' and emp_name='2'

I want to oass both values of emp_id and emp_name as parameters.Could you help me this..

Thanks,
livefree
 
Jaikiran Pai
Marshal
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"live free"

Welcome to JavaRanch

Please check your private message, for a message from JavaRanch.
 
Jaikiran Pai
Marshal
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by live free:
I have normal sql query like...

select * from emplyee where emp_id='1' and emp_name='2'

I want to oass both values of emp_id and emp_name as parameters.Could you help me this..


It would be something like:



Also, have a look at Chapter-16 Native SQL in Hibernate.

Originally posted by live free:
Hi,

New to Hiebrnate..

This will get you started.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic