Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hibernate: wildcard matching using Criteria

 
Choon-Chern Lim
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a DB int column, "myNumber". How do I do wildcard matching using Criteria? Basically, 11 should return 112, 211, etc.

I tried the below, but didn't work... and I assume I had to convert the int column to String first, but wasn't sure how to.



Thank you.
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Don't need to do that

"%" + longObject + "%" should work.

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