string « Search « JPA Q&A





1. hibernate string search question    coderanch.com

If you want the actual ContactName objects back, try using any of the follwing: Query q = Session.createQuery( "from ContactName where name like :name" ); q.setParameter( "name", arg + "%"); Query q = Session.createQuery( "from ContactName where name like :name||'%'" ); q.setParameter( "name", arg); Query q = Session.createQuery( "from ContactName where name like '" + arg + "%'" ); Personally, I ...

2. How to find the final query string for saved search?    forum.hibernate.org

Hi, My project has a requirement that a user can save his query (NOT query results) so that the next time he can simply click a web link to perform the same query. I feel that I need to find out the final query string Hibernate generated for the last query and save this string in a table for future use. ...