i use jpa/hibernate configuration can i use detechedcriteria a hibernate library

165 views
Skip to first unread message

kindersur...@yahoo.fr

unread,
Jul 27, 2011, 9:45:46 PM7/27/11
to Criteria4JPA
i dont want to use criteria JPa. i have a example for my code in
hibernate and i want use detachedcriteria that why i usse a config
JPA/hibernate.
can we use Detached criteria how could to use hibernate.

Christian Kaltepoth

unread,
Jul 28, 2011, 3:48:59 AM7/28/11
to criter...@googlegroups.com
Sorry, but I don't understand your concrete question.

DetachedCriteria is currently not supported by Criteria4JPA. I never
used DetachedCriteria very often with Hibernate. For inner selects I'm
always using Restrictions.jpqlRestriction() of Criteria4JPA.

If you really need DetachedCriteria and are using Hibernate under the
covers, you should directly use the Hibernate Criteria API. You can
get the current Hibernate session from the EntityManager this way:

Session session = (Session) entityManager.getDelegate();

I hope this helps. :)

Christian


2011/7/28 stan...@yahoo.fr <kindersur...@yahoo.fr>:

--
Christian Kaltepoth
Blog: http://chkal.blogspot.com/
Twitter: http://twitter.com/chkal

Yvan Khekhone

unread,
Aug 16, 2011, 8:55:49 AM8/16/11
to criter...@googlegroups.com
ok tx you i use hibernate detached criteria

--- En date de : Jeu 28.7.11, Christian Kaltepoth <chri...@kaltepoth.de> a écrit :
Reply all
Reply to author
Forward
0 new messages