[hibernate-commits] Hibernate SVN: r17823 - in core/trunk/core/src/main/java/org/hibernate/dialect: resolver and 1 other directory.

hibernate-commits at lists.jboss.org hibernate-commits at lists.jboss.org
Fri Oct 23 01:08:40 EDT 2009


Author: steve.ebersole at jboss.com
Date: 2009-10-23 01:08:40 -0400 (Fri, 23 Oct 2009)
New Revision: 17823

Modified:
   core/trunk/core/src/main/java/org/hibernate/dialect/SybaseASE15Dialect.java
   core/trunk/core/src/main/java/org/hibernate/dialect/SybaseAnywhereDialect.java
   core/trunk/core/src/main/java/org/hibernate/dialect/SybaseDialect.java
   core/trunk/core/src/main/java/org/hibernate/dialect/resolver/StandardDialectResolver.java
Log:
HHH-4442 - Change StandardDialectResolver to use SybaseASE15Dialect over deprecated SybaseDialect


Modified: core/trunk/core/src/main/java/org/hibernate/dialect/SybaseASE15Dialect.java
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/dialect/SybaseASE15Dialect.java	2009-10-22 21:22:46 UTC (rev 17822)
+++ core/trunk/core/src/main/java/org/hibernate/dialect/SybaseASE15Dialect.java	2009-10-23 05:08:40 UTC (rev 17823)
@@ -1,11 +1,10 @@
-//$Id $
 /*
  * Hibernate, Relational Persistence for Idiomatic Java
  *
- * Copyright (c) 2009, Red Hat Middleware LLC or third-party contributors as
- * indicated by the @author tags or express copyright attribution
- * statements applied by the authors.  All third-party contributions are
- * distributed under license by Red Hat Middleware LLC.
+ * Copyright (c) 2009 by Red Hat Inc and/or its affiliates or by
+ * third-party contributors as indicated by either @author tags or express
+ * copyright attribution statements applied by the authors.  All
+ * third-party contributions are distributed under license by Red Hat Inc.
  *
  * This copyrighted material is made available to anyone wishing to use, modify,
  * copy, or redistribute it subject to the terms and conditions of the GNU
@@ -21,32 +20,22 @@
  * Free Software Foundation, Inc.
  * 51 Franklin Street, Fifth Floor
  * Boston, MA  02110-1301  USA
- *
  */
 package org.hibernate.dialect;
 
-import java.sql.CallableStatement;
-import java.sql.ResultSet;
-import java.sql.SQLException;
 import java.sql.Types;
-import java.util.Map;
-import java.util.Iterator;
 
 import org.hibernate.Hibernate;
-import org.hibernate.LockMode;
-import org.hibernate.cfg.Environment;
 import org.hibernate.dialect.function.AnsiTrimEmulationFunction;
-import org.hibernate.dialect.function.CharIndexFunction;
-import org.hibernate.dialect.function.NoArgSQLFunction;
 import org.hibernate.dialect.function.SQLFunctionTemplate;
-import org.hibernate.dialect.function.StandardSQLFunction;
-import org.hibernate.dialect.function.VarArgsSQLFunction;
 
 /**
- * An SQL dialect compatible with Sybase and MS SQL Server.
+ * An SQL dialect targetting Sybase Adaptive Server Enterprise (ASE) 15 and higher.
+ * <p/>
+ * TODO : verify if this also works with 12/12.5
+ * 
  * @author Gavin King
  */
-
 public class SybaseASE15Dialect extends AbstractTransactSQLDialect {
 	public SybaseASE15Dialect() {
 		super();
@@ -68,13 +57,22 @@
 	public boolean supportsCascadeDelete() {
 		return false;
 	}
+
     /**
-     * By default, Sybase string comparisons are case-insensitive.<br>
-     * If the DB is configured to be case-sensitive, then the return value will be incorrect.
+     * By default, Sybase string comparisons are case-insensitive.
+	 * <p/>
+     * If the DB is configured to be case-sensitive, then this return
+	 * value will be incorrect.
      */
     public boolean areStringComparisonsCaseInsensitive() {
         return true;
-    }     
+    }
+
+	/**
+	 * Actually Sybase does not support LOB locators at al.
+	 *
+	 * @return false.
+	 */
 	public boolean supportsExpectedLobUsagePattern() {
 		return false;
 	}

Modified: core/trunk/core/src/main/java/org/hibernate/dialect/SybaseAnywhereDialect.java
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/dialect/SybaseAnywhereDialect.java	2009-10-22 21:22:46 UTC (rev 17822)
+++ core/trunk/core/src/main/java/org/hibernate/dialect/SybaseAnywhereDialect.java	2009-10-23 05:08:40 UTC (rev 17823)
@@ -1,10 +1,10 @@
 /*
  * Hibernate, Relational Persistence for Idiomatic Java
  *
- * Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
- * indicated by the @author tags or express copyright attribution
- * statements applied by the authors.  All third-party contributions are
- * distributed under license by Red Hat Middleware LLC.
+ * Copyright (c) 2009 by Red Hat Inc and/or its affiliates or by
+ * third-party contributors as indicated by either @author tags or express
+ * copyright attribution statements applied by the authors.  All
+ * third-party contributions are distributed under license by Red Hat Inc.
  *
  * This copyrighted material is made available to anyone wishing to use, modify,
  * copy, or redistribute it subject to the terms and conditions of the GNU
@@ -20,7 +20,6 @@
  * Free Software Foundation, Inc.
  * 51 Franklin Street, Fifth Floor
  * Boston, MA  02110-1301  USA
- *
  */
 package org.hibernate.dialect;
 
@@ -31,7 +30,6 @@
  * @author ?
  */
 public class SybaseAnywhereDialect extends AbstractTransactSQLDialect {
-
 	/**
 	 * Sybase Anywhere syntax would require a "DEFAULT" for each column specified,
 	 * but I suppose Hibernate use this syntax only with tables with just 1 column
@@ -40,10 +38,11 @@
 		return "values (default)";
 	}
 
-
 	/**
-	 * ASA does not require to drop constraint before dropping tables, and DROP statement
-	 * syntax used by Hibernate to drop constraint is not compatible with ASA, so disable it
+	 * ASA does not require to drop constraint before dropping tables, so disable it.
+	 * <p/>
+	 * NOTE : Also, the DROP statement syntax used by Hibernate to drop constraints is 
+	 * not compatible with ASA.
 	 */
 	public boolean dropConstraints() {
 		return false;

Modified: core/trunk/core/src/main/java/org/hibernate/dialect/SybaseDialect.java
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/dialect/SybaseDialect.java	2009-10-22 21:22:46 UTC (rev 17822)
+++ core/trunk/core/src/main/java/org/hibernate/dialect/SybaseDialect.java	2009-10-23 05:08:40 UTC (rev 17823)
@@ -31,9 +31,11 @@
  * Sybase.  Those functions have now been split.
  * {@link AbstractTransactSQLDialect} should be used as the base class for 
  * TransactSQL-based dialects.
- * 
+ *
  * @author Gail Badner
- * @deprecated use {@link SybaseASE15Dialect} or {@link SQLServerDialect} instead.
+ * @deprecated use {@link AbstractTransactSQLDialect},
+ * {@link SybaseASE15Dialect} or {@link SQLServerDialect} instead depending on
+ * need.
  */
 public class SybaseDialect extends AbstractTransactSQLDialect {
 }

Modified: core/trunk/core/src/main/java/org/hibernate/dialect/resolver/StandardDialectResolver.java
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/dialect/resolver/StandardDialectResolver.java	2009-10-22 21:22:46 UTC (rev 17822)
+++ core/trunk/core/src/main/java/org/hibernate/dialect/resolver/StandardDialectResolver.java	2009-10-23 05:08:40 UTC (rev 17823)
@@ -37,13 +37,13 @@
 import org.hibernate.dialect.DerbyDialect;
 import org.hibernate.dialect.IngresDialect;
 import org.hibernate.dialect.SQLServerDialect;
-import org.hibernate.dialect.SybaseDialect;
 import org.hibernate.dialect.InformixDialect;
 import org.hibernate.dialect.DB2Dialect;
 import org.hibernate.dialect.Oracle10gDialect;
 import org.hibernate.dialect.Oracle9iDialect;
 import org.hibernate.dialect.Oracle8iDialect;
 import org.hibernate.dialect.SybaseAnywhereDialect;
+import org.hibernate.dialect.SybaseASE15Dialect;
 
 /**
  * The standard Hibernate resolver.
@@ -86,7 +86,7 @@
 		}
 
 		if ( "Sybase SQL Server".equals( databaseName ) || "Adaptive Server Enterprise".equals( databaseName ) ) {
-			return new SybaseDialect();
+			return new SybaseASE15Dialect();
 		}
 
 		if ( databaseName.startsWith( "Adaptive Server Anywhere" ) ) {



More information about the hibernate-commits mailing list