-
1. Bean managed or Container managed entities use third party ORM tools???
wdfink Feb 9, 2011 7:05 AM (in response to meenarajani)Hi,
as far as I understand you mix EJB2 and EJB3 specification.
1+2)
CMP or BMP Container/Bean Managed Persistence is part of EJB2 spec.
With EJB3 you will have simple Java classes with JPA annotations. The application server or even the JVM supports that you bind a persistence manager like Hibernate or Toplink to persist the data to a database.
You might use specific annotations of toplink or hibernate to have more control about the the persistence manager but it is not necessary from the beginning.
3)
http://http://www.oracle.com/technetwork/java/javaee/tech/persistence-jsp-140049.html Oracle
or the specification itself
http://jcp.org/aboutJava/communityprocess/final/jsr220/index.html
might be a good starting point.
Also you will find help within the JBoss wiki pages
-
2. Re: Bean managed or Container managed entities use third party ORM tools???
meenarajani Feb 17, 2011 2:16 AM (in response to wdfink)Hi Wolf,
You were right I was imixing EJB2 and EJB3.
As you have mentioned annotation is not necessary to have control of persistence manager. I have a question is it necessary to use third party ORM tool, like Toplink or Hibernate for EJB3? Does this implementation of ORM is provided by JBOSS container or JPA 2.0 ?
for example I have following persistence.xml file, if I am commenting the provider " <provider>org.hibernate.ejb.HibernatePersistence</provider> " I am not seeing any tables being created in Database. When I uncomment the provider and properties, my application is creating table and inserting data.
If container by default provides it I mean if it is possible then what do we substitute for provider or any other configuration which let me use container' s own persistence management.
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
<persistence-unit name="BookAuthorApp3-ejbPU" transaction-type="JTA">
<!-- <provider>org.hibernate.ejb.HibernatePersistence</provider> -->
<jta-data-source>java:/PostgresDS</jta-data-source>
<exclude-unlisted-classes>false</exclude-unlisted-classes>
<!-- <properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQLDialect" />
<property name="hibernate.hbm2ddl.auto" value="update"/>
</properties> -->
</persistence-unit>
</persistence>
Thanks
Meena