Marcin, thanks for this post! This is great information and it's nice
to see them back to back like this.
I threw it up in our documentation here:
http://cwiki.apache.org/OPENEJBx30/common-persistenceprovider-properties.html
-David
On Aug 5, 2008, at 12:01 AM, Marcin Kwapisz wrote:
<properties>
<property name="eclipselink.target-database"
value="org.eclipse.persistence.platform.database.HSQLPlatform"/>
<property name="eclipselink.ddl-generation" value="create-
tables"/>
<property name="eclipselink.ddl-generation.output-mode"
value="database"/>
</properties>
[Marcin Kwapisz]
Hi David,
Properties in main persistence.xml (for toplink) are almost the
same. I have set generation.output-mode to both to verify ddl
statements. Database platform is detected automatically (check the
log) so you can skip that property.
The following properties are for toplink, openjpa and hibernate
respectively. As you can see, Hibernate was the less demanding from
"unexperienced" user like me.
<properties>
<!--http://www.oracle.com/technology/products/ias/toplink/JPA/essentials/toplink-jpa-extensions.html--
>
<property name="toplink.ddl-generation" value="drop-and-create-
tables"/>
<property name="toplink.logging.level" value="FINEST"/>
<property name="toplink.ddl-generation.output-mode"
value="both"/>
<property name="toplink.target-server"
value="pl.zsk.samples.ejbservice.OpenEJBServerPlatform"/>
</properties>
<properties>
<!--http://openjpa.apache.org/faq.html-->
<!-- does not create foreign keys, creates schema and
deletes content of a database (deleteTableContents - foreign keys
are created twice???), use dropDB instead -->
<property name="openjpa.jdbc.SynchronizeMappings"
value="buildSchema(foreignKeys=true,schemaAction='dropDB,add')"/>
<!--Resolves the problem with foreign key integrity -
joined entities are persisted sometimes in wrong order??? (verify
it)-->
<property name="openjpa.jdbc.SchemaFactory"
value="native(foreignKeys=true)" />
<!--Create foreign keys-->
<property name="openjpa.jdbc.MappingDefaults"
value="ForeignKeyDeleteAction=restrict,
JoinForeignKeyDeleteAction=restrict"/>
<property name="openjpa.Log"
value="DefaultLevel=TRACE,SQL=TRACE" />
</properties>
<properties>
<property name="hibernate.hbm2ddl.auto" value="create-
drop"/>
<property name="hibernate.transaction.manager_lookup_class"
value="org.apache.openejb.hibernate.TransactionManagerLookup"/>
</properties>
Regards
--
Marcin Kwapisz
Division of Computer Networks
Technical Univeristy of Lodz, Poland