wood burning stoves 2.0*
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 The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript 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+"%")
 
 
subject: how do I code a like clause with Hibernate?