Fix performance regression in dal-startup introduced by cset 3e4e4993fee9
authorStefan Hühner <stefan.huehner@openbravo.com>
Wed, 09 Mar 2011 00:28:31 +0100
changeset 11128 78bdd4129fe5
parent 11127 1dedb4b3d3ec
child 11129 7b499d87c794
child 11130 4b68adbd9972
Fix performance regression in dal-startup introduced by cset 3e4e4993fee9
That cset changed the license header of the hbm.xml template file which led
to the double inclusion of the content into the template doubling its size
and affecting dal-startup time severly (15-30s slower). This fix reverts to the
earlier runtime by using a placeholder string which doesn't overlap with text
from the license header.
src/org/openbravo/dal/core/DalMappingGenerator.java
src/org/openbravo/dal/core/template_main.hbm.xml
--- a/src/org/openbravo/dal/core/DalMappingGenerator.java	Tue Mar 08 21:02:18 2011 +0100
+++ b/src/org/openbravo/dal/core/DalMappingGenerator.java	Wed Mar 09 00:28:31 2011 +0100
@@ -84,7 +84,7 @@
       sb.append(entityMapping);
     }
     final String mainTemplate = readFile(MAIN_TEMPLATE_FILE);
-    final String result = mainTemplate.replace("content", sb.toString());
+    final String result = mainTemplate.replace("contentPlaceholder", sb.toString());
 
     if (log.isDebugEnabled()) {
       log.debug(result);
--- a/src/org/openbravo/dal/core/template_main.hbm.xml	Tue Mar 08 21:02:18 2011 +0100
+++ b/src/org/openbravo/dal/core/template_main.hbm.xml	Wed Mar 09 00:28:31 2011 +0100
@@ -21,7 +21,7 @@
  -->
 <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
 <hibernate-mapping>
-content
+contentPlaceholder
   <filter-def name="activeFilter">
     <filter-param name="activeParam" type="string"/>
   </filter-def>