-
1. Re: EJB query support LIKE?
mistamoasn Sep 20, 2005 8:03 AM (in response to javatwo)http://www.hibernate.org/hib_docs/reference/en/html/queryhql.html
look at section "11.4. The select clause"...
have a look at this too...
http://www.solarmetric.com/resources/ejbql-quickref.pdf -
2. Re: EJB query support LIKE?
javatwo Sep 20, 2005 3:14 PM (in response to javatwo)Thanks for the links. Very helpful. I am wondering how to access Hibernate session from Session beans so that I can create a Criteria. It seems that EntityManager is the only API to Hibernate. Thanks!
-
3. Re: EJB query support LIKE?
javatwo Sep 20, 2005 3:53 PM (in response to javatwo)List resultList =em.createQuery("from Student s where s.name like 'John%'").getResultList();
System.out.println("***QUERY getResult: n=" + resultList.size()) ;
----------
No results returned. There are many students whose names start with 'John' in Student table. Did I miss anything? If I change like to equal, it works fine.
where s.name='John1'
but it is not what I want. I need like to work.
Thanks for help. -
4. Re: EJB query support LIKE?
bill.burke Sep 20, 2005 4:46 PM (in response to javatwo)"javatwo" wrote:
Thanks for the links. Very helpful. I am wondering how to access Hibernate session from Session beans so that I can create a Criteria. It seems that EntityManager is the only API to Hibernate. Thanks!
http://docs.jboss.com/ejb3/app-server/reference/build/reference/en/html/hibernate.html