File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Object Relational Mapping and the fly likes Hibernate with EJB3 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Hibernate with EJB3" Watch "Hibernate with EJB3" New topic
Author

Hibernate with EJB3

Nikhil Jain
Ranch Hand

Joined: May 15, 2005
Posts: 385
Can hibernate be used with EJBs. I know that there is support for JPA. But can we use other ORM with EJB3.


SCJP 1.4, SCWCD 1.4, SCBCD 1.5
Scott Selikoff
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3703
    
    5

Yes, to answer your first question, but I'll move this into Object Relationship Mapping tool anyway.


My Blog: Down Home Country Coding with Scott Selikoff
Marko Novakovic
Greenhorn

Joined: Jul 13, 2008
Posts: 6
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>
 
Consider Paul's rocket mass heater.
 
subject: Hibernate with EJB3
 
Similar Threads
which version of jboss supports EJB3 and jdk6
Hibernate Annotations
Question for Authors: Hibernate vs. EJB 3.0
JPA v/s Hibernate
difference between hibernate and ejb