• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hibernate: Running a query using an object

 
Dave Alvarado
Ranch Hand
Posts: 436
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I'm using Hibernate core 3.3.2.GA. Let's say I have this object ...



Given an instance of the above object in which some fields are null and some are populated with actual values, what is the easiest way to run a query matching objects in the database that have the same values (ignoring the fields that are null)?

Hope this makes sense, - Dave
 
Rishi Shehrawat
Ranch Hand
Posts: 218
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have a look at Hibernate QBE (query by example)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic