Win a copy of Java 9 Revealed this week in the Features new in Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Hibernate: Running a query using an object  RSS feed

 
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)
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!