The moose likes Object Relational Mapping and the fly likes Hibernate Query with AND condition Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Object Relational Mapping
Reply Bookmark "Hibernate Query with AND condition" Watch "Hibernate Query with AND condition" New topic
Author

Hibernate Query with AND condition

Rohit Kumar
Ranch Hand

Joined: Jul 19, 2007
Posts: 35
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
Saloon Keeper

Joined: Jul 20, 2005
Posts: 6718

"live free"

Welcome to JavaRanch

Please check your private message, for a message from JavaRanch.


[My Blog] [JavaRanch Journal]
Jaikiran Pai
Saloon Keeper

Joined: Jul 20, 2005
Posts: 6718

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.
 
 
subject: Hibernate Query with AND condition
 
Threads others viewed
apply query after concate two column
Oracle Cursor
ResultSet is closed??
Oracle Database SQL confusion
Merging siblings with same tag name in xml documents
WebSphere development made easy
without the weight of IBM tools
http://www.myeclipseide.com