automatic schema update done by configuring the localsessionfactory for
authorErik Brakkee <erik@brakkee.org>
Sat, 22 Mar 2008 17:59:03 +0000 (17:59 +0000)
committerErik Brakkee <erik@brakkee.org>
Sat, 22 Mar 2008 17:59:03 +0000 (17:59 +0000)
testing.

security/src/test/resources/properties/test.org.wamblee.security.hibernate.properties
security/src/test/resources/spring/test.org.wamblee.security.database.xml
support/src/main/java/org/wamblee/cache/EhCache.java
support/src/main/java/org/wamblee/persistence/hibernate/HibernateSupport.java

index 42491b2caf4e2826fa1da0d2fcedd01202ffbdda..47a21e2a0468d0b76b28d87b08f564c5bd4ed540 100644 (file)
@@ -9,6 +9,11 @@ hibernate.dialect=org.hibernate.dialect.MySQLInnoDBDialect
 ###################################################################################
 hibernate.show_sql=false
 
+##############################################################################
+# schema update for test 
+##############################################################################
+hibernate.schemaupdate=true
+
 ###################################################################################
 # hibernate cache provider
 ###################################################################################
index af51a1e3de6c5a1a3312738fa1b3c406ebc60c7a..c92090539ee40b1f12d5cd880bf6c5f2aa076817 100644 (file)
@@ -17,6 +17,9 @@
                 <prop key="hibernate.cache.use_query_cache">${hibernate.cache.use_query_cache}</prop>
             </props>
         </property>
+        <property name="schemaUpdate">
+            <value>${hibernate.schemaupdate}</value>
+        </property>
         <property name="mappingResources"><ref bean="hibernateMappingFiles"/></property>
     </bean>
     
index 0dcb2b7a2fcf3907b8d24e60ed363d64b91c9bcf..ffbbab4baf850ebcfa0a7e4d13594e4f9bb35870 100644 (file)
@@ -24,6 +24,8 @@ import net.sf.ehcache.Cache;
 import net.sf.ehcache.CacheException;
 import net.sf.ehcache.CacheManager;
 import net.sf.ehcache.Element;
+import net.sf.ehcache.config.Configuration;
+import net.sf.ehcache.config.ConfigurationFactory;
 
 import org.apache.log4j.Logger;
 import org.wamblee.io.InputResource;
@@ -61,7 +63,7 @@ public class EhCache<KeyType extends Serializable, ValueType extends Serializabl
             throws IOException, CacheException {
         InputStream is = aResource.getInputStream();
         try {
-            _manager = CacheManager.create(is);
+               _manager = new CacheManager(is);
             _cache = _manager.getCache(aCacheName);
             if (_cache == null) {
                 LOGGER.warn("Creating cache '" + aCacheName
index 65160dd1a8b2cc76df35e7c37ace8189cc44da00..85087f32ace59948a28df72a9d70cd0da8cce2c9 100644 (file)
@@ -130,7 +130,7 @@ public class HibernateSupport extends HibernateDaoSupport {
         }
         aProcessed.add(elem);
 
-        LOG.info("Setting pk/version on " + aPersistent + " from " + aMerged);
+        LOG.debug("Setting pk/version on " + aPersistent + " from " + aMerged);
 
         if (aPersistent.getPrimaryKey() != null
                 && !aMerged.getPrimaryKey().equals(aPersistent.getPrimaryKey())) {