• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Querying All Fields

 
Pradeep Chandrasekharan Nair
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have one keyword field in UI and I need to search all fields in the table for that keyword value. Is there any Class like Example (this is to search for a given instance) available for this.

Thanks in Advance

Regards
Pradep
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Unfortunately there really isn't. However what you could do is include a "formula" attribute in your class that will combine all the fields into one field then do a like query on it. But well. I would probably not map that because that would mean that combination of all fields would always take place even when you didn't need it. So I would probably write a method to do it with the object once it returns from the query.

The other thing to check out is Hibernate's new search functionality, I forgot what it was called but you can find it at hibernate.org

Mark
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic