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 how do I code a like clause with Hibernate? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "how do I code a like clause with Hibernate?" Watch "how do I code a like clause with Hibernate?" New topic
Author

how do I code a like clause with Hibernate?

Max Tomlinson
Ranch Hand

Joined: Jul 17, 2001
Posts: 365
Tired several suggestion on this board and could not get them to work

I want to code a simple

createQuery("from ... where e.name like :name etc.....")

I want the equivalent of name%

thank you
Max
Max Tomlinson
Ranch Hand

Joined: Jul 17, 2001
Posts: 365
as usually happens, I figure it out once I've posted a question:

so, for anyone interested:

-->where e.name like :name bla bla


then:

-->query.setParameter("name", someStr+"%")
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how do I code a like clause with Hibernate?
 
Similar Threads
iterate
Help with privatizing array
get Property-Field-Name via Reflection
Request Parameters in EL
Unable to view Applet in client machine.