Win a copy of 97 Things Every Java Programmer Should Know this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

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

 
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
 
Ranch Hand
Posts: 1374
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why don't you write the HQL for that.
 
You don't know me, but I've been looking all over the world for. Thanks to the help from this tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic