This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma 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+"%")
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: how do I code a like clause with Hibernate?
 
It's not a secret anymore!