[hibernate-commits] Hibernate SVN: r14085 - core/branches/Branch_3_2/src/org/hibernate/dialect.

hibernate-commits at lists.jboss.org hibernate-commits at lists.jboss.org
Tue Oct 16 17:09:15 EDT 2007


Author: steve.ebersole at jboss.com
Date: 2007-10-16 17:09:15 -0400 (Tue, 16 Oct 2007)
New Revision: 14085

Modified:
   core/branches/Branch_3_2/src/org/hibernate/dialect/HSQLDialect.java
Log:
HHH-2857 : assume schema support in HSQLDialect

Modified: core/branches/Branch_3_2/src/org/hibernate/dialect/HSQLDialect.java
===================================================================
--- core/branches/Branch_3_2/src/org/hibernate/dialect/HSQLDialect.java	2007-10-16 21:04:41 UTC (rev 14084)
+++ core/branches/Branch_3_2/src/org/hibernate/dialect/HSQLDialect.java	2007-10-16 21:09:15 UTC (rev 14085)
@@ -11,7 +11,6 @@
 import org.hibernate.JDBCException;
 import org.hibernate.engine.SessionImplementor;
 import org.hibernate.persister.entity.Lockable;
-import org.hibernate.util.ReflectHelper;
 import org.hibernate.cfg.Environment;
 import org.hibernate.dialect.function.NoArgSQLFunction;
 import org.hibernate.dialect.function.StandardSQLFunction;
@@ -29,14 +28,13 @@
  * <p/>
  * Note this version supports HSQLDB version 1.8 and higher, only.
  *
- * @author Christoph Sturm, Phillip Baird
+ * @author Christoph Sturm
+ * @author Phillip Baird
  */
 public class HSQLDialect extends Dialect {
 
 	private static final Log log = LogFactory.getLog( HSQLDialect.class );
 
-	private boolean schemaSupport;
-
 	public HSQLDialect() {
 		super();
 		registerColumnType( Types.BIGINT, "bigint" );
@@ -130,17 +128,6 @@
 		registerFunction( "concat", new VarArgsSQLFunction( Hibernate.STRING, "(", "||", ")" ) );
 
 		getDefaultProperties().setProperty( Environment.STATEMENT_BATCH_SIZE, DEFAULT_BATCH_SIZE );
-
-		try {
-			// Does present HSQLDB Database class support schemas?
-			// yuck! Perhaps we should think about a new dialect?  Especially
-			// if more things are going to break back-compat moving forward
-			ReflectHelper.classForName( "org.hsqldb.Database" ).getDeclaredField( "schemaManager" );
-			schemaSupport = true;
-		}
-		catch (Throwable t) {
-			schemaSupport = false;
-		}
 	}
 
 	public String getAddColumnString() {
@@ -219,12 +206,8 @@
 	}
 
 	public String getQuerySequencesString() {
-		if ( schemaSupport ) {
-			return "select sequence_name from information_schema.system_sequences";
-		}
-		else {
-			return "select sequence_name from system_sequences";
-		}
+		// this assumes schema support, which is present in 1.8.0 and later...
+		return "select sequence_name from information_schema.system_sequences";
 	}
 
 	public ViolatedConstraintNameExtracter getViolatedConstraintNameExtracter() {




More information about the hibernate-commits mailing list