• Post Reply Bookmark Topic Watch Topic
  • New Topic

Hibernate: wildcard matching using Criteria  RSS feed

 
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: 17309
11
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
Boost this thread!