Fixes issue 9376: Uninstalling a module which added a column in a standard Openbravo table fails
authorMartin Taal <martin.taal@openbravo.com>
Mon, 08 Jun 2009 13:54:55 +0200
changeset 3982 97e2fba62f90
parent 3981 e4caff5b5554
child 3983 449b220a5301
Fixes issue 9376: Uninstalling a module which added a column in a standard Openbravo table fails
build.xml
src/build.xml
--- a/build.xml	Mon Jun 08 13:49:27 2009 +0200
+++ b/build.xml	Mon Jun 08 13:54:55 2009 +0200
@@ -542,7 +542,7 @@
     <antcall target="core.lib" />
     <ant dir="${base.db}" target="update.database.mod" inheritAll="true" inheritRefs="true" />
     <antcall target="db.apply.modules" />
-    <antcall target="generate.entities.quick" />
+    <antcall target="generate.entities" />
   </target>
 
   <target name="update.customized.database" depends="init,code.rev">
@@ -620,11 +620,17 @@
       <classpath refid="project.class.path" />
     </taskdef>
     <antcall target="update.database.mod" />
-    <applyModule userId="0" propertiesFile="${base.config}/Openbravo.properties" reinitializemodel="true" />
+    <!-- 
+    Note: set reinitializeModel to false because otherwise the dal is re-initialized with classes and a model
+    which are not in sync (see issue: https://issues.openbravo.com/view.php?id=9376)
+    Note: applyModule can also be moved to a java task to fork it (to prevent this from occuring)
+    but then no output is visible for the user.
+    -->
+    <applyModule userId="0" propertiesFile="${base.config}/Openbravo.properties" reinitializemodel="false"/>
     <antcall target="compile.deploy" />
     <!--antcall target="deploy.context"/-->
   </target>
-
+  
   <!-- 
 		apparently this does not overwrite the default catalina_opts, only
 		if it is not set will it be set to the value below 
--- a/src/build.xml	Mon Jun 08 13:49:27 2009 +0200
+++ b/src/build.xml	Mon Jun 08 13:54:55 2009 +0200
@@ -182,7 +182,7 @@
   </target>
 
   <target name="generate.entities" depends="compile.src.gen,clean.src.gen">
-    <taskdef name="workflow" classpathref="project.class.path" classname="org.openbravo.base.gen.GenerateEntitiesTask" />
+      <taskdef name="workflow" classpathref="project.class.path" classname="org.openbravo.base.gen.GenerateEntitiesTask" />
     <!-- debug="true" will perform the in-memory model initialization before generating entities
 	if an error occurs then, then a stacktrace is printed. -->
     <workflow debug="false" srcGenPath="${base.src.gen}" propertiesFile="${base.config}/Openbravo.properties" file="${base.src}/org/openbravo/base/gen/gen_entity.oaw" fork="true" maxmemory="${build.maxmemory}">
@@ -192,7 +192,15 @@
         <path refid="project.class.path" />
       </classpath>
     </workflow>
-    
+
+    <!--
+    see issue: https://issues.openbravo.com/view.php?id=9331
+    Custom columns in standard tables should support a reference to a table in the module
+    if this occurs then possible the following javac has to be enabled instead of the two javacs below
+    <javac srcdir="${base.src}:${base.src.gen}" excludes="org/openbravo/base/*,org/openbravo/base/secureApp/**,org/openbravo/erpCommon/**,org/openbravo/erpReports/**,org/openbravo/scheduling/**,org/openbravo/service/web/**,org/openbravo/service/system/**,org/openbravo/service/rest/**,org/openbravo/service/db/**,org/openbravo/authentication/**,org/openbravo/services/**" destdir="${build}" encoding="UTF-8" fork="true" memorymaximumsize="${build.maxmemory}" debug="true" debuglevel="lines,vars,source" deprecation="on">
+      <classpath refid="project.class.path" />
+    </javac>
+    -->
     <javac srcdir="${base.src}:${base.src.gen}" includes="org/openbravo/model/**,org/openbravo/base/structure/**,org/openbravo/dal/**,org/openbravo/service/dataset/**" destdir="${build}" encoding="UTF-8" fork="true" memorymaximumsize="${build.maxmemory}" debug="true" debuglevel="lines,vars,source" deprecation="on">
       <classpath refid="project.class.path" />
     </javac>
@@ -220,6 +228,15 @@
         <path refid="project.class.path" />
       </classpath>
     </workflow>
+
+    <!--
+      see issue: https://issues.openbravo.com/view.php?id=9331
+      Custom columns in standard tables should support a reference to a table in the module
+      if this occurs then possible the following javac has to be enabled instead of the two javacs below
+    <javac srcdir="${base.src}:${base.src.gen}" destdir="${build}" encoding="UTF-8" fork="true" memorymaximumsize="${build.maxmemory}" debug="true" debuglevel="lines,vars,source" deprecation="on">
+      <classpath refid="project.class.path" />      
+    </javac>
+    -->
     <javac srcdir="${base.src}:${base.src.gen}" includes="org/openbravo/model/**,org/openbravo/base/structure/**,org/openbravo/dal/**,org/openbravo/service/dataset/**" destdir="${build}" encoding="UTF-8" fork="true" memorymaximumsize="${build.maxmemory}" debug="true" debuglevel="lines,vars,source" deprecation="on">
       <classpath refid="project.class.path" />      
     </javac>