-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Access Hibernate diretctly from JPA EntityManager? (dirty!)
PostPosted: Wed Mar 09, 2011 2:49 pm 
Newbie

Joined: Sat Mar 08, 2008 5:27 pm
Posts: 1
Hi folks,

I am inside an EAR running withing Glassfish 2 with Hibernate as my persistence provider. So what I should do probably is use the JPA EntityManager. I would like to know if there is some way to work with the Hibernate session directly, although only the EntityManager is injected in my code?
I am fully aware that this could be considered as a dirty hack from the JPA perspective....

Michael


Top
 Profile  
 
 Post subject: Re: Access Hibernate diretctly from JPA EntityManager? (dirty!)
PostPosted: Thu Mar 10, 2011 4:28 am 
Expert
Expert

Joined: Thu Jan 08, 2009 6:16 am
Posts: 661
Location: Germany
you can use
Code:
(Session)entityManager.getDelegate()

_________________
-----------------
Need advanced help? http://www.viada.eu


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.