Commits

Anonymous committed 23df6db

Specify hibernate dialect in 2.x db helper code, so we can reuse hibernate.props for v2/3/3.1

git-svn-id: http://svn.opensymphony.com/svn/propertyset/trunk@168bf3cbcdd-1c1a-0410-9a68-d6f521e3fa7b

  • Participants
  • Parent commits 181e462

Comments (0)

Files changed (3)

File src/test/com/opensymphony/module/propertyset/DatabaseHelper.java

         URL propertySet = DatabaseHelper.class.getResource("/com/opensymphony/module/propertyset/hibernate/PropertySetItemImpl.hbm.xml");
         Assert.assertTrue(propertySet != null);
         configuration.addURL(propertySet);
-
+        configuration.setProperty("hibernate.dialect", "net.sf.hibernate.dialect.MckoiDialect");
         new SchemaExport(configuration).create(false, true);
 
         return configuration;

File src/test/com/opensymphony/module/propertyset/TestObject.java

  * Date: May 22, 2004
  */
 public class TestObject implements Serializable {
+    //~ Static fields/initializers /////////////////////////////////////////////
+
+    private static final long serialVersionUID = 261939103282846342L;
+
     //~ Instance fields ////////////////////////////////////////////////////////
 
     private long id;
-    private static final long serialVersionUID = 261939103282846342L;
 
-  //~ Constructors ///////////////////////////////////////////////////////////
+    //~ Constructors ///////////////////////////////////////////////////////////
 
     public TestObject(long id) {
         this.id = id;
             return true;
         }
 
-      if(obj == null) {
-        return false;
-      }
+        if (obj == null) {
+            return false;
+        }
+
         if (this.getClass() != obj.getClass()) {
             return false;
         }

File src/test/hibernate.properties

-######################
-### Query Language ###
-######################
-
-## define query language constants / function names
-
-hibernate.query.substitutions true 1, false 0, yes 'Y', no 'N'
-
-## package imports
-
-hibernate.query.imports net.sf.hibernate.test, net.sf.hibernate.eg
-
-hibernate.dialect net.sf.hibernate.dialect.MckoiDialect
-
-#################
-### Platforms ###
-#################
-
-## JNDI Datasource
-
+#hibernate.dialect org.hibernate.dialect.MckoiDialect
+hibernate.hbm2ddl.auto=update
 hibernate.connection.datasource jdbc/CreateDS
-#hibernate.connection.username db2
-#hibernate.connection.password db2
-
-#################################
-### Hibernate Connection Pool ###
-#################################
-
-hibernate.connection.pool_size 1
-hibernate.statement_cache.size 25
-
-
-
-
-
-##############################
-### Miscellaneous Settings ###
-##############################
-
-## print all generated SQL to the console
-
 hibernate.show_sql false
-
-
-## specify a JDBC isolation level
-
-#hibernate.connection.isolation 4
-
-
-## set the JDBC fetch size
-
-#hibernate.jdbc.fetch_size 25
-
-
-## set the maximum JDBC 2 batch size (a nonzero value enables batching)
-
-hibernate.jdbc.batch_size 0
-
-
-## enable use of JDBC 2 scrollable ResultSets (specifying a Dialect will cause Hibernate to use a sensible default)
-
-#hibernate.jdbc.use_scrollable_resultset true
-
-
-## use streams when writing binary types to / from JDBC
-
 hibernate.jdbc.use_streams_for_binary true
-
-
-## specify a default schema for unqualified tablenames
-
-#hibernate.default_schema test
-
-
-## use a custom stylesheet for XML generation (if not specified, hibernate-default.xslt will be used)
-
-#hibernate.xml.output_stylesheet C:/Hibernate/net/sf/hibernate/hibernate-default.xslt
-
-
-## enable outerjoin fetching (specifying a Dialect will cause Hibernate to use sensible default)
-
-#hibernate.use_outer_join false
-
-
-## enable CGLIB reflection optimizer (enabled by default)
-
-hibernate.cglib.use_reflection_optimizer false
-
-
-
-############
-### JNDI ###
-############
-
-## specify a JNDI name for the SessionFactory
-
-#hibernate.session_factory_name hibernate/session_factory
-
-
-## Hibernate uses JNDI to bind a name to a SessionFactory and to look up the JTA UserTransaction;
-## if hibernate.jndi.* are not specified, Hibernate will use the default InitialContext() which
-## is the best approach in an application server
-
-#file system
-#hibernate.jndi.class com.sun.jndi.fscontext.RefFSContextFactory
-#hibernate.jndi.url file:/
-
-#WebSphere
-#hibernate.jndi.class com.ibm.websphere.naming.WsnInitialContextFactory
-#hibernate.jndi.url iiop://localhost:900/
-
+#hibernate.cglib.use_reflection_optimizer false