Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hibernate with EJB3

 
Nikhil Jain
Ranch Hand
Posts: 389
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can hibernate be used with EJBs. I know that there is support for JPA. But can we use other ORM with EJB3.
 
Scott Selikoff
author
Saloon Keeper
Posts: 4014
18
Eclipse IDE Flex Google Web Toolkit
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, to answer your first question, but I'll move this into Object Relationship Mapping tool anyway.
 
Marko Novakovic
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Of course it can be used.

Only you cannot use Criteria API and Session. At least i didn't manage to get it from EntityManager.getDelegate()

Here is part of my persistence.xml file..

<persistence-unit name="StockEmuTest-ejbPU" transaction-type="JTA">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>jdbc/stockemu_mysql</jta-data-source>
....
<properties>
<property name="hibernate.hbm2ddl.auto" value="update"/>
<property name="hibernate.show_sql" value="true"/>
<property name="hibernate.format_sql" value="true"/>
</properties>
</persistence-unit>
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic