HHH-4442 - Change StandardDialectResolver to use SybaseASE15Dialect over deprecated SybaseDialect
git-svn-id: https://svn.jboss.org/repos/hibernate/core/trunk@17823 1b8cb986-b30d-0410-93ca-fae66ebed9b2
This commit is contained in:
parent
9e76e1b184
commit
30dba20ce4
|
@ -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 class SybaseASE15Dialect extends AbstractTransactSQLDialect {
|
|||
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;
|
||||
}
|
||||
|
|
|
@ -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 @@ package org.hibernate.dialect;
|
|||
* @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 @@ public class SybaseAnywhereDialect extends AbstractTransactSQLDialect {
|
|||
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;
|
||||
|
|
|
@ -31,9 +31,11 @@ package org.hibernate.dialect;
|
|||
* 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 {
|
||||
}
|
||||
|
|
|
@ -37,13 +37,13 @@ import org.hibernate.dialect.PostgreSQLDialect;
|
|||
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 @@ public class StandardDialectResolver extends AbstractDialectResolver{
|
|||
}
|
||||
|
||||
if ( "Sybase SQL Server".equals( databaseName ) || "Adaptive Server Enterprise".equals( databaseName ) ) {
|
||||
return new SybaseDialect();
|
||||
return new SybaseASE15Dialect();
|
||||
}
|
||||
|
||||
if ( databaseName.startsWith( "Adaptive Server Anywhere" ) ) {
|
||||
|
|
Loading…
Reference in New Issue