Author: dgolovin
Date: 2007-10-01 18:38:44 -0400 (Mon, 01 Oct 2007)
New Revision: 3934
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDelegete.java
Log:
http://jira.jboss.org/jira/browse/JBIDE-972
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDelegete.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDelegete.java 2007-10-01
22:08:41 UTC (rev 3933)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDelegete.java 2007-10-01
22:38:44 UTC (rev 3934)
@@ -227,6 +227,16 @@
model.setProperty(ISeamFacetDataModelProperties.SEAM_PROJECT_NAME, project.getName());
model.setProperty(ISeamFacetDataModelProperties.SEAM_TEST_PROJECT,
project.getName()+"-test");
+ Boolean dbExists =
(Boolean)model.getProperty(ISeamFacetDataModelProperties.DB_ALREADY_EXISTS);
+ Boolean dbRecreate =
(Boolean)model.getProperty(ISeamFacetDataModelProperties.RECREATE_TABLES_AND_DATA_ON_DEPLOY);
+ if(!dbExists && !dbRecreate) {
+ model.setProperty(ISeamFacetDataModelProperties.HIBERNATE_HBM2DDL_AUTO,"update");
+ } else if(dbExists && !dbRecreate) {
+ model.setProperty(ISeamFacetDataModelProperties.HIBERNATE_HBM2DDL_AUTO,"validate");
+ } else if(dbRecreate) {
+ model.setProperty(ISeamFacetDataModelProperties.HIBERNATE_HBM2DDL_AUTO,"create-drop");
+ }
+
final File webContentFolder = folder.getLocation().toFile();
final File webInfFolder = new File(webContentFolder,"WEB-INF");
final File webInfClasses = new File(webInfFolder,"classes");