persistence@glassfish.java.net

Code changes for issue 454 - javaSE and create-tables option in javaSE case

From: Pramod Gopinath <Pramod.Gopinath_at_Sun.COM>
Date: Wed, 22 Mar 2006 16:35:54 -0800

The related issue is
https://glassfish.dev.java.net/issues/show_bug.cgi?id=454

The change has been made to
src/java/oracle/toplink/essentials/ejb/cmp3/EntityManagerFactoryProvider.java

In the case of javaSE, if the user has defined
"toplink.ddl-generation=create-tables", we should just create the tables
in the database. Currently we also do a drop of the tables.

Another issue is that in the case of inside container (appserver
environement) even if the user has defined
"toplink.ddl-generation=create-tables", we still want to generate both
the create as well as the drop files.

I have attached the diffs and the source file.

Thanks
Pramod


Index: src/java/oracle/toplink/essentials/ejb/cmp3/EntityManagerFactoryProvider.java
===================================================================
RCS file: /cvs/glassfish/entity-persistence/src/java/oracle/toplink/essentials/ejb/cmp3/EntityManagerFactoryProvider.java,v
retrieving revision 1.25
diff -r1.25 EntityManagerFactoryProvider.java
324,325c324,328
< SchemaManager mgr, boolean shouldDropFirst) {
< mgr.replaceDefaultTables(true);
---
>         SchemaManager mgr, boolean shouldDropFirst) {
>         if (shouldDropFirst)  
>             mgr.replaceDefaultTables(true); 
>         else 
>             mgr.createDefaultTables(); 
343,344c346,349
<         mgr.setCreateSQLFiles(false);            
<         createOrReplaceDefaultTables(mgr, shouldDropFirst);
---
>         mgr.setCreateSQLFiles(false);
>         // When running in the application server environment always ensure that
>         // we write out both the drop and create table files.
>         createOrReplaceDefaultTables(mgr, true);