• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Can I put two conditions in where attribute on the class element of mapping file

 
Bikash Paul
Ranch Hand
Posts: 342
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I'm new to this hibernate world. I'm writing one hibernate mapping file to fetch the data from a table(SUPS). But I want to put two conditions in where attribute on the class element.

I want my hibernate mapping file should work as below SQL query:

select SUPPLIER,SUP_NAME from SUPS where SUP_STATUS = 'A' and SUPPLIER_PARENT IS NULL;

My Hibernate mapping file(SupplierImpl.hbm.xml):




I could put only one condition in the where attribute but couldn't find how I can put the other condition.I'm using Hibernate-Version: 2.1.7.

Could you please guide me how I can put the other condition.

Thanks,
-Bikash
 
Bikash Paul
Ranch Hand
Posts: 342
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Could anyone please guide me how I can do that.

Thanks,
-Bikash
 
Vikas Kapoor
Ranch Hand
Posts: 1374
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why don't you write the HQL for that.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic