This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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+"%")
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
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.