File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Object Relational Mapping and the fly likes Hibernate: wildcard matching using Criteria Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Object Relational Mapping
Reply Bookmark "Hibernate: wildcard matching using Criteria" Watch "Hibernate: wildcard matching using Criteria" New topic
Author

Hibernate: wildcard matching using Criteria

Choon-Chern Lim
Ranch Hand

Joined: Aug 29, 2005
Posts: 74
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

Joined: Feb 05, 2001
Posts: 16622

Don't need to do that

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

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
 
 
subject: Hibernate: wildcard matching using Criteria
 
Threads others viewed
NX: Will they think my GUI is too simple?
Valid DD
how can v pass javascript values to jsp
Int to String
LinkedList Problem
WebSphere development made easy
without the weight of IBM tools
http://www.myeclipseide.com