This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell 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


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+"%")
 
GeeCON Prague 2014
 
subject: how do I code a like clause with Hibernate?