[hibernate-commits] Hibernate SVN: r15898 - in core/branches/Branch_3_2: src/org/hibernate/dialect and 10 other directories.
hibernate-commits at lists.jboss.org
hibernate-commits at lists.jboss.org
Wed Feb 4 22:48:51 EST 2009
Author: gbadner
Date: 2009-02-04 22:48:51 -0500 (Wed, 04 Feb 2009)
New Revision: 15898
Added:
core/branches/Branch_3_2/src/org/hibernate/dialect/AbstractTransactSQLDialect.java
core/branches/Branch_3_2/src/org/hibernate/dialect/SybaseASE15Dialect.java
core/branches/Branch_3_2/test/org/hibernate/test/dialect/unit/lockhint/SybaseASE15LockHintsTest.java
Modified:
core/branches/Branch_3_2/etc/hibernate.properties
core/branches/Branch_3_2/src/org/hibernate/dialect/SQLServerDialect.java
core/branches/Branch_3_2/src/org/hibernate/dialect/Sybase11Dialect.java
core/branches/Branch_3_2/src/org/hibernate/dialect/SybaseAnywhereDialect.java
core/branches/Branch_3_2/src/org/hibernate/dialect/SybaseDialect.java
core/branches/Branch_3_2/test/org/hibernate/test/AllTests.java
core/branches/Branch_3_2/test/org/hibernate/test/connections/AggressiveReleaseTest.java
core/branches/Branch_3_2/test/org/hibernate/test/generated/TimestampGeneratedValuesWithCachingTest.java
core/branches/Branch_3_2/test/org/hibernate/test/hql/ASTParserLoadingTest.java
core/branches/Branch_3_2/test/org/hibernate/test/hql/HQLTest.java
core/branches/Branch_3_2/test/org/hibernate/test/interfaceproxy/InterfaceProxyTest.java
core/branches/Branch_3_2/test/org/hibernate/test/legacy/FooBarTest.java
core/branches/Branch_3_2/test/org/hibernate/test/legacy/SQLFunctionsTest.java
core/branches/Branch_3_2/test/org/hibernate/test/lob/SerializableTypeTest.java
core/branches/Branch_3_2/test/org/hibernate/test/mixed/MixedTest.java
core/branches/Branch_3_2/test/org/hibernate/test/stats/StatsTest.java
Log:
HHH-3712 : Reorganize the Sybase dialect class hierarchy, add SybaseASE15Dialect, and mark SybaseDialect as deprecated
Modified: core/branches/Branch_3_2/etc/hibernate.properties
===================================================================
--- core/branches/Branch_3_2/etc/hibernate.properties 2009-02-04 23:14:05 UTC (rev 15897)
+++ core/branches/Branch_3_2/etc/hibernate.properties 2009-02-05 03:48:51 UTC (rev 15898)
@@ -122,6 +122,7 @@
## Sybase
#hibernate.dialect org.hibernate.dialect.SybaseDialect
+#hibernate.dialect org.hibernate.dialect.SybaseASE15Dialect
#hibernate.connection.driver_class com.sybase.jdbc2.jdbc.SybDriver
#hibernate.connection.username sa
#hibernate.connection.password sasasa
Added: core/branches/Branch_3_2/src/org/hibernate/dialect/AbstractTransactSQLDialect.java
===================================================================
--- core/branches/Branch_3_2/src/org/hibernate/dialect/AbstractTransactSQLDialect.java (rev 0)
+++ core/branches/Branch_3_2/src/org/hibernate/dialect/AbstractTransactSQLDialect.java 2009-02-05 03:48:51 UTC (rev 15898)
@@ -0,0 +1,239 @@
+//$Id: $
+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.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 abstract base class for Sybase and MS SQL Server dialects.
+ * @author Gavin King
+ */
+
+/* package-private */
+abstract class AbstractTransactSQLDialect extends Dialect {
+ public AbstractTransactSQLDialect() {
+ super();
+ registerColumnType( Types.BIT, "tinyint" ); //Sybase BIT type does not support null values
+ registerColumnType( Types.BIGINT, "numeric(19,0)" );
+ registerColumnType( Types.SMALLINT, "smallint" );
+ registerColumnType( Types.TINYINT, "tinyint" );
+ registerColumnType( Types.INTEGER, "int" );
+ registerColumnType( Types.CHAR, "char(1)" );
+ registerColumnType( Types.VARCHAR, "varchar($l)" );
+ registerColumnType( Types.FLOAT, "float" );
+ registerColumnType( Types.DOUBLE, "double precision" );
+ registerColumnType( Types.DATE, "datetime" );
+ registerColumnType( Types.TIME, "datetime" );
+ registerColumnType( Types.TIMESTAMP, "datetime" );
+ registerColumnType( Types.VARBINARY, "varbinary($l)" );
+ registerColumnType( Types.NUMERIC, "numeric($p,$s)" );
+ registerColumnType( Types.BLOB, "image" );
+ registerColumnType( Types.CLOB, "text" );
+
+ registerFunction( "ascii", new StandardSQLFunction("ascii", Hibernate.INTEGER) );
+ registerFunction( "char", new StandardSQLFunction("char", Hibernate.CHARACTER) );
+ registerFunction( "len", new StandardSQLFunction("len", Hibernate.LONG) );
+ registerFunction( "lower", new StandardSQLFunction("lower") );
+ registerFunction( "upper", new StandardSQLFunction("upper") );
+ registerFunction( "str", new StandardSQLFunction("str", Hibernate.STRING) );
+ registerFunction( "ltrim", new StandardSQLFunction("ltrim") );
+ registerFunction( "rtrim", new StandardSQLFunction("rtrim") );
+ registerFunction( "reverse", new StandardSQLFunction("reverse") );
+ registerFunction( "space", new StandardSQLFunction("space", Hibernate.STRING) );
+
+ registerFunction( "user", new NoArgSQLFunction("user", Hibernate.STRING) );
+
+ registerFunction( "current_timestamp", new NoArgSQLFunction("getdate", Hibernate.TIMESTAMP) );
+ registerFunction( "current_time", new NoArgSQLFunction("getdate", Hibernate.TIME) );
+ registerFunction( "current_date", new NoArgSQLFunction("getdate", Hibernate.DATE) );
+
+ registerFunction( "getdate", new NoArgSQLFunction("getdate", Hibernate.TIMESTAMP) );
+ registerFunction( "getutcdate", new NoArgSQLFunction("getutcdate", Hibernate.TIMESTAMP) );
+ registerFunction( "day", new StandardSQLFunction("day", Hibernate.INTEGER) );
+ registerFunction( "month", new StandardSQLFunction("month", Hibernate.INTEGER) );
+ registerFunction( "year", new StandardSQLFunction("year", Hibernate.INTEGER) );
+ registerFunction( "datename", new StandardSQLFunction("datename", Hibernate.STRING) );
+
+ registerFunction( "abs", new StandardSQLFunction("abs") );
+ registerFunction( "sign", new StandardSQLFunction("sign", Hibernate.INTEGER) );
+
+ registerFunction( "acos", new StandardSQLFunction("acos", Hibernate.DOUBLE) );
+ registerFunction( "asin", new StandardSQLFunction("asin", Hibernate.DOUBLE) );
+ registerFunction( "atan", new StandardSQLFunction("atan", Hibernate.DOUBLE) );
+ registerFunction( "cos", new StandardSQLFunction("cos", Hibernate.DOUBLE) );
+ registerFunction( "cot", new StandardSQLFunction("cot", Hibernate.DOUBLE) );
+ registerFunction( "exp", new StandardSQLFunction("exp", Hibernate.DOUBLE) );
+ registerFunction( "log", new StandardSQLFunction( "log", Hibernate.DOUBLE) );
+ registerFunction( "log10", new StandardSQLFunction("log10", Hibernate.DOUBLE) );
+ registerFunction( "sin", new StandardSQLFunction("sin", Hibernate.DOUBLE) );
+ registerFunction( "sqrt", new StandardSQLFunction("sqrt", Hibernate.DOUBLE) );
+ registerFunction( "tan", new StandardSQLFunction("tan", Hibernate.DOUBLE) );
+ registerFunction( "pi", new NoArgSQLFunction("pi", Hibernate.DOUBLE) );
+ registerFunction( "square", new StandardSQLFunction("square") );
+ registerFunction( "rand", new StandardSQLFunction("rand", Hibernate.FLOAT) );
+
+ registerFunction("radians", new StandardSQLFunction("radians", Hibernate.DOUBLE) );
+ registerFunction("degrees", new StandardSQLFunction("degrees", Hibernate.DOUBLE) );
+
+ registerFunction( "round", new StandardSQLFunction("round") );
+ registerFunction( "ceiling", new StandardSQLFunction("ceiling") );
+ registerFunction( "floor", new StandardSQLFunction("floor") );
+
+ registerFunction( "isnull", new StandardSQLFunction("isnull") );
+
+ registerFunction( "concat", new VarArgsSQLFunction( Hibernate.STRING, "(","+",")" ) );
+
+ registerFunction( "length", new StandardSQLFunction( "len", Hibernate.INTEGER ) );
+ registerFunction( "trim", new SQLFunctionTemplate( Hibernate.STRING, "ltrim(rtrim(?1))") );
+ registerFunction( "locate", new CharIndexFunction() );
+
+ getDefaultProperties().setProperty(Environment.STATEMENT_BATCH_SIZE, NO_BATCH);
+ }
+
+ public String getAddColumnString() {
+ return "add";
+ }
+ public String getNullColumnString() {
+ return " null";
+ }
+ public boolean qualifyIndexName() {
+ return false;
+ }
+
+ public String getForUpdateString() {
+ return "";
+ }
+
+ public boolean supportsIdentityColumns() {
+ return true;
+ }
+ public String getIdentitySelectString() {
+ return "select @@identity";
+ }
+ public String getIdentityColumnString() {
+ return "identity not null"; //starts with 1, implicitly
+ }
+
+ public boolean supportsInsertSelectIdentity() {
+ return true;
+ }
+
+ public String appendIdentitySelectToInsert(String insertSQL) {
+ return insertSQL + "\nselect @@identity";
+ }
+
+ public String appendLockHint(LockMode mode, String tableName) {
+ if ( mode.greaterThan( LockMode.READ ) ) {
+ return tableName + " holdlock";
+ }
+ else {
+ return tableName;
+ }
+ }
+
+ public String applyLocksToSql(String sql, Map aliasedLockModes, Map keyColumnNames) {
+ Iterator itr = aliasedLockModes.entrySet().iterator();
+ StringBuffer buffer = new StringBuffer( sql );
+ int correction = 0;
+ while ( itr.hasNext() ) {
+ final Map.Entry entry = ( Map.Entry ) itr.next();
+ final LockMode lockMode = ( LockMode ) entry.getValue();
+ if ( lockMode.greaterThan( LockMode.READ ) ) {
+ final String alias = ( String ) entry.getKey();
+ int start = -1, end = -1;
+ if ( sql.endsWith( " " + alias ) ) {
+ start = ( sql.length() - alias.length() ) + correction;
+ end = start + alias.length();
+ }
+ else {
+ int position = sql.indexOf( " " + alias + " " );
+ if ( position <= -1 ) {
+ position = sql.indexOf( " " + alias + "," );
+ }
+ if ( position > -1 ) {
+ start = position + correction + 1;
+ end = start + alias.length();
+ }
+ }
+
+ if ( start > -1 ) {
+ final String lockHint = appendLockHint( lockMode, alias );
+ buffer.replace( start, end, lockHint );
+ correction += ( lockHint.length() - alias.length() );
+ }
+ }
+ }
+ return buffer.toString();
+ }
+
+ public int registerResultSetOutParameter(CallableStatement statement, int col) throws SQLException {
+ return col; // sql server just returns automatically
+ }
+
+ public ResultSet getResultSet(CallableStatement ps) throws SQLException {
+ boolean isResultSet = ps.execute();
+// This assumes you will want to ignore any update counts
+ while ( !isResultSet && ps.getUpdateCount() != -1 ) {
+ isResultSet = ps.getMoreResults();
+ }
+// You may still have other ResultSets or update counts left to process here
+// but you can't do it now or the ResultSet you just got will be closed
+ return ps.getResultSet();
+ }
+
+ public boolean supportsCurrentTimestampSelection() {
+ return true;
+ }
+
+ public boolean isCurrentTimestampSelectStringCallable() {
+ return false;
+ }
+
+ public String getCurrentTimestampSelectString() {
+ return "select getdate()";
+ }
+
+ public boolean supportsTemporaryTables() {
+ return true;
+ }
+
+ public String generateTemporaryTableName(String baseTableName) {
+ return "#" + baseTableName;
+ }
+
+ public boolean dropTemporaryTableAfterUse() {
+ return true; // sql-server, at least needed this dropped after use; strange!
+ }
+
+
+ // Overridden informational metadata ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ public boolean supportsEmptyInList() {
+ return false;
+ }
+
+ public boolean supportsExistsInSelect() {
+ return false;
+ }
+
+ public boolean doesReadCommittedCauseWritersToBlockReaders() {
+ return true;
+ }
+
+ public boolean doesRepeatableReadCauseReadersToBlockWriters() {
+ return true;
+ }
+}
Modified: core/branches/Branch_3_2/src/org/hibernate/dialect/SQLServerDialect.java
===================================================================
--- core/branches/Branch_3_2/src/org/hibernate/dialect/SQLServerDialect.java 2009-02-04 23:14:05 UTC (rev 15897)
+++ core/branches/Branch_3_2/src/org/hibernate/dialect/SQLServerDialect.java 2009-02-05 03:48:51 UTC (rev 15898)
@@ -14,14 +14,18 @@
*
* @author Gavin King
*/
-public class SQLServerDialect extends SybaseDialect {
+public class SQLServerDialect extends AbstractTransactSQLDialect {
public SQLServerDialect() {
registerColumnType( Types.VARBINARY, "image" );
registerColumnType( Types.VARBINARY, 8000, "varbinary($l)" );
+ registerFunction( "second", new SQLFunctionTemplate(Hibernate.INTEGER, "datepart(second, ?1)") );
+ registerFunction( "minute", new SQLFunctionTemplate(Hibernate.INTEGER, "datepart(minute, ?1)") );
+ registerFunction( "hour", new SQLFunctionTemplate(Hibernate.INTEGER, "datepart(hour, ?1)") );
registerFunction( "locate", new StandardSQLFunction("charindex", Hibernate.INTEGER) );
+ registerFunction( "extract", new SQLFunctionTemplate( Hibernate.INTEGER, "datepart(?1, ?3)" ) );
registerFunction( "mod", new SQLFunctionTemplate( Hibernate.INTEGER, "?1 % ?2" ) );
registerFunction( "bit_length", new SQLFunctionTemplate( Hibernate.INTEGER, "datalength(?1) * 8" ) );
@@ -112,10 +116,6 @@
return false;
}
- public boolean supportsCascadeDelete() {
- return true;
- }
-
public boolean supportsCircularCascadeDeleteConstraints() {
// SQL Server (at least up through 2005) does not support defining
// cascade delete constraints which can circel back to the mutating
@@ -123,10 +123,6 @@
return false;
}
- public boolean supportsExpectedLobUsagePattern() {
- return true;
- }
-
public boolean supportsLobValueChangePropogation() {
// note: at least my local SQL Server 2005 Express shows this not working...
return false;
Modified: core/branches/Branch_3_2/src/org/hibernate/dialect/Sybase11Dialect.java
===================================================================
--- core/branches/Branch_3_2/src/org/hibernate/dialect/Sybase11Dialect.java 2009-02-04 23:14:05 UTC (rev 15897)
+++ core/branches/Branch_3_2/src/org/hibernate/dialect/Sybase11Dialect.java 2009-02-05 03:48:51 UTC (rev 15898)
@@ -8,7 +8,7 @@
* A SQL dialect suitable for use with Sybase 11.9.2 (specifically: avoids ANSI JOIN syntax)
* @author Colm O' Flaherty
*/
-public class Sybase11Dialect extends SybaseDialect {
+public class Sybase11Dialect extends AbstractTransactSQLDialect {
public Sybase11Dialect() {
super();
}
Added: core/branches/Branch_3_2/src/org/hibernate/dialect/SybaseASE15Dialect.java
===================================================================
--- core/branches/Branch_3_2/src/org/hibernate/dialect/SybaseASE15Dialect.java (rev 0)
+++ core/branches/Branch_3_2/src/org/hibernate/dialect/SybaseASE15Dialect.java 2009-02-05 03:48:51 UTC (rev 15898)
@@ -0,0 +1,43 @@
+//$Id: SybaseDialect.java 15760 2009-01-09 09:52:13Z gbadner $
+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.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.
+ * @author Gavin King
+ */
+
+public class SybaseASE15Dialect extends AbstractTransactSQLDialect {
+ public SybaseASE15Dialect() {
+ super();
+ registerFunction( "second", new SQLFunctionTemplate(Hibernate.INTEGER, "datepart(second, ?1)") );
+ registerFunction( "minute", new SQLFunctionTemplate(Hibernate.INTEGER, "datepart(minute, ?1)") );
+ registerFunction( "hour", new SQLFunctionTemplate(Hibernate.INTEGER, "datepart(hour, ?1)") );
+ registerFunction( "extract", new SQLFunctionTemplate( Hibernate.INTEGER, "datepart(?1, ?3)" ) );
+ }
+
+ // Overridden informational metadata ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ public boolean supportsCascadeDelete() {
+ return false;
+ }
+
+ public boolean supportsExpectedLobUsagePattern() {
+ return false;
+ }
+}
Modified: core/branches/Branch_3_2/src/org/hibernate/dialect/SybaseAnywhereDialect.java
===================================================================
--- core/branches/Branch_3_2/src/org/hibernate/dialect/SybaseAnywhereDialect.java 2009-02-04 23:14:05 UTC (rev 15897)
+++ core/branches/Branch_3_2/src/org/hibernate/dialect/SybaseAnywhereDialect.java 2009-02-05 03:48:51 UTC (rev 15898)
@@ -6,7 +6,7 @@
* (Tested on ASA 8.x)
* @author ?
*/
-public class SybaseAnywhereDialect extends SybaseDialect {
+public class SybaseAnywhereDialect extends AbstractTransactSQLDialect {
/**
* Sybase Anywhere syntax would require a "DEFAULT" for each column specified,
@@ -29,4 +29,4 @@
return false;
}
-}
\ No newline at end of file
+}
Modified: core/branches/Branch_3_2/src/org/hibernate/dialect/SybaseDialect.java
===================================================================
--- core/branches/Branch_3_2/src/org/hibernate/dialect/SybaseDialect.java 2009-02-04 23:14:05 UTC (rev 15897)
+++ core/branches/Branch_3_2/src/org/hibernate/dialect/SybaseDialect.java 2009-02-05 03:48:51 UTC (rev 15898)
@@ -1,253 +1,16 @@
//$Id$
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.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.
- * @author Gavin King
+ * SybaseDialect is being deprecated.
+ *
+ * AbstractTransactSQLDialect should be used as a base
+ * class for Sybase and MS SQL Server dialects.
+ *
+ * @author Gail Badner
+ * @deprecated SybaseASE15Dialect or SQLServerDialect should be
+ * used instead.
*/
-public class SybaseDialect extends Dialect {
- public SybaseDialect() {
- super();
- registerColumnType( Types.BIT, "tinyint" ); //Sybase BIT type does not support null values
- registerColumnType( Types.BIGINT, "numeric(19,0)" );
- registerColumnType( Types.SMALLINT, "smallint" );
- registerColumnType( Types.TINYINT, "tinyint" );
- registerColumnType( Types.INTEGER, "int" );
- registerColumnType( Types.CHAR, "char(1)" );
- registerColumnType( Types.VARCHAR, "varchar($l)" );
- registerColumnType( Types.FLOAT, "float" );
- registerColumnType( Types.DOUBLE, "double precision" );
- registerColumnType( Types.DATE, "datetime" );
- registerColumnType( Types.TIME, "datetime" );
- registerColumnType( Types.TIMESTAMP, "datetime" );
- registerColumnType( Types.VARBINARY, "varbinary($l)" );
- registerColumnType( Types.NUMERIC, "numeric($p,$s)" );
- registerColumnType( Types.BLOB, "image" );
- registerColumnType( Types.CLOB, "text" );
-
- registerFunction( "ascii", new StandardSQLFunction("ascii", Hibernate.INTEGER) );
- registerFunction( "char", new StandardSQLFunction("char", Hibernate.CHARACTER) );
- registerFunction( "len", new StandardSQLFunction("len", Hibernate.LONG) );
- registerFunction( "lower", new StandardSQLFunction("lower") );
- registerFunction( "upper", new StandardSQLFunction("upper") );
- registerFunction( "str", new StandardSQLFunction("str", Hibernate.STRING) );
- registerFunction( "ltrim", new StandardSQLFunction("ltrim") );
- registerFunction( "rtrim", new StandardSQLFunction("rtrim") );
- registerFunction( "reverse", new StandardSQLFunction("reverse") );
- registerFunction( "space", new StandardSQLFunction("space", Hibernate.STRING) );
-
- registerFunction( "user", new NoArgSQLFunction("user", Hibernate.STRING) );
-
- registerFunction( "current_timestamp", new NoArgSQLFunction("getdate", Hibernate.TIMESTAMP) );
- registerFunction( "current_time", new NoArgSQLFunction("getdate", Hibernate.TIME) );
- registerFunction( "current_date", new NoArgSQLFunction("getdate", Hibernate.DATE) );
-
- registerFunction( "getdate", new NoArgSQLFunction("getdate", Hibernate.TIMESTAMP) );
- registerFunction( "getutcdate", new NoArgSQLFunction("getutcdate", Hibernate.TIMESTAMP) );
- registerFunction( "day", new StandardSQLFunction("day", Hibernate.INTEGER) );
- registerFunction( "month", new StandardSQLFunction("month", Hibernate.INTEGER) );
- registerFunction( "year", new StandardSQLFunction("year", Hibernate.INTEGER) );
- registerFunction( "datename", new StandardSQLFunction("datename", Hibernate.STRING) );
- registerFunction( "second", new SQLFunctionTemplate(Hibernate.INTEGER, "datepart(second, ?1)") );
- registerFunction( "minute", new SQLFunctionTemplate(Hibernate.INTEGER, "datepart(minute, ?1)") );
- registerFunction( "hour", new SQLFunctionTemplate(Hibernate.INTEGER, "datepart(hour, ?1)") );
- registerFunction( "extract", new SQLFunctionTemplate( Hibernate.INTEGER, "datepart(?1, ?3)" ) );
-
- registerFunction( "abs", new StandardSQLFunction("abs") );
- registerFunction( "sign", new StandardSQLFunction("sign", Hibernate.INTEGER) );
-
- registerFunction( "acos", new StandardSQLFunction("acos", Hibernate.DOUBLE) );
- registerFunction( "asin", new StandardSQLFunction("asin", Hibernate.DOUBLE) );
- registerFunction( "atan", new StandardSQLFunction("atan", Hibernate.DOUBLE) );
- registerFunction( "cos", new StandardSQLFunction("cos", Hibernate.DOUBLE) );
- registerFunction( "cot", new StandardSQLFunction("cot", Hibernate.DOUBLE) );
- registerFunction( "exp", new StandardSQLFunction("exp", Hibernate.DOUBLE) );
- registerFunction( "log", new StandardSQLFunction( "log", Hibernate.DOUBLE) );
- registerFunction( "log10", new StandardSQLFunction("log10", Hibernate.DOUBLE) );
- registerFunction( "sin", new StandardSQLFunction("sin", Hibernate.DOUBLE) );
- registerFunction( "sqrt", new StandardSQLFunction("sqrt", Hibernate.DOUBLE) );
- registerFunction( "tan", new StandardSQLFunction("tan", Hibernate.DOUBLE) );
- registerFunction( "pi", new NoArgSQLFunction("pi", Hibernate.DOUBLE) );
- registerFunction( "square", new StandardSQLFunction("square") );
- registerFunction( "rand", new StandardSQLFunction("rand", Hibernate.FLOAT) );
-
- registerFunction("radians", new StandardSQLFunction("radians", Hibernate.DOUBLE) );
- registerFunction("degrees", new StandardSQLFunction("degrees", Hibernate.DOUBLE) );
-
- registerFunction( "round", new StandardSQLFunction("round") );
- registerFunction( "ceiling", new StandardSQLFunction("ceiling") );
- registerFunction( "floor", new StandardSQLFunction("floor") );
-
- registerFunction( "isnull", new StandardSQLFunction("isnull") );
-
- registerFunction( "concat", new VarArgsSQLFunction( Hibernate.STRING, "(","+",")" ) );
-
- registerFunction( "length", new StandardSQLFunction( "len", Hibernate.INTEGER ) );
- registerFunction( "trim", new SQLFunctionTemplate( Hibernate.STRING, "ltrim(rtrim(?1))") );
- registerFunction( "locate", new CharIndexFunction() );
-
- registerFunction( "mod", new SQLFunctionTemplate( Hibernate.INTEGER, "?1 % ?2" ) );
- registerFunction( "bit_length", new SQLFunctionTemplate( Hibernate.INTEGER, "datalength(?1) * 8" ) );
-
- getDefaultProperties().setProperty(Environment.STATEMENT_BATCH_SIZE, NO_BATCH);
- }
-
- public String getAddColumnString() {
- return "add";
- }
- public String getNullColumnString() {
- return " null";
- }
- public boolean qualifyIndexName() {
- return false;
- }
-
- public String getForUpdateString() {
- return "";
- }
-
- public boolean supportsIdentityColumns() {
- return true;
- }
- public String getIdentitySelectString() {
- return "select @@identity";
- }
- public String getIdentityColumnString() {
- return "identity not null"; //starts with 1, implicitly
- }
-
- public boolean supportsInsertSelectIdentity() {
- return true;
- }
-
- public String appendIdentitySelectToInsert(String insertSQL) {
- return insertSQL + "\nselect @@identity";
- }
-
- public String appendLockHint(LockMode mode, String tableName) {
- if ( mode.greaterThan( LockMode.READ ) ) {
- return tableName + " holdlock";
- }
- else {
- return tableName;
- }
- }
-
- public String applyLocksToSql(String sql, Map aliasedLockModes, Map keyColumnNames) {
- Iterator itr = aliasedLockModes.entrySet().iterator();
- StringBuffer buffer = new StringBuffer( sql );
- int correction = 0;
- while ( itr.hasNext() ) {
- final Map.Entry entry = ( Map.Entry ) itr.next();
- final LockMode lockMode = ( LockMode ) entry.getValue();
- if ( lockMode.greaterThan( LockMode.READ ) ) {
- final String alias = ( String ) entry.getKey();
- int start = -1, end = -1;
- if ( sql.endsWith( " " + alias ) ) {
- start = ( sql.length() - alias.length() ) + correction;
- end = start + alias.length();
- }
- else {
- int position = sql.indexOf( " " + alias + " " );
- if ( position <= -1 ) {
- position = sql.indexOf( " " + alias + "," );
- }
- if ( position > -1 ) {
- start = position + correction + 1;
- end = start + alias.length();
- }
- }
-
- if ( start > -1 ) {
- final String lockHint = appendLockHint( lockMode, alias );
- buffer.replace( start, end, lockHint );
- correction += ( lockHint.length() - alias.length() );
- }
- }
- }
- return buffer.toString();
- }
-
- public int registerResultSetOutParameter(CallableStatement statement, int col) throws SQLException {
- return col; // sql server just returns automatically
- }
-
- public ResultSet getResultSet(CallableStatement ps) throws SQLException {
- boolean isResultSet = ps.execute();
-// This assumes you will want to ignore any update counts
- while ( !isResultSet && ps.getUpdateCount() != -1 ) {
- isResultSet = ps.getMoreResults();
- }
-// You may still have other ResultSets or update counts left to process here
-// but you can't do it now or the ResultSet you just got will be closed
- return ps.getResultSet();
- }
-
- public boolean supportsCurrentTimestampSelection() {
- return true;
- }
-
- public boolean isCurrentTimestampSelectStringCallable() {
- return false;
- }
-
- public String getCurrentTimestampSelectString() {
- return "select getdate()";
- }
-
- public boolean supportsTemporaryTables() {
- return true;
- }
-
- public String generateTemporaryTableName(String baseTableName) {
- return "#" + baseTableName;
- }
-
- public boolean dropTemporaryTableAfterUse() {
- return true; // sql-server, at least needed this dropped after use; strange!
- }
-
-
- // Overridden informational metadata ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
- public boolean supportsCascadeDelete() {
- return false;
- }
-
- public boolean supportsExpectedLobUsagePattern() {
- return false;
- }
-
- public boolean supportsEmptyInList() {
- return false;
- }
-
- public boolean supportsExistsInSelect() {
- return false;
- }
-
- public boolean doesReadCommittedCauseWritersToBlockReaders() {
- return true;
- }
-
- public boolean doesRepeatableReadCauseReadersToBlockWriters() {
- return true;
- }
+public class SybaseDialect extends AbstractTransactSQLDialect {
}
Modified: core/branches/Branch_3_2/test/org/hibernate/test/AllTests.java
===================================================================
--- core/branches/Branch_3_2/test/org/hibernate/test/AllTests.java 2009-02-04 23:14:05 UTC (rev 15897)
+++ core/branches/Branch_3_2/test/org/hibernate/test/AllTests.java 2009-02-05 03:48:51 UTC (rev 15898)
@@ -44,6 +44,7 @@
import org.hibernate.test.deletetransient.DeleteTransientEntityTest;
import org.hibernate.test.dialect.functional.cache.SQLFunctionsInterSystemsTest;
import org.hibernate.test.dialect.unit.lockhint.SQLServerLockHintsTest;
+import org.hibernate.test.dialect.unit.lockhint.SybaseASE15LockHintsTest;
import org.hibernate.test.dialect.unit.lockhint.SybaseLockHintsTest;
import org.hibernate.test.discriminator.DiscriminatorTest;
import org.hibernate.test.dynamicentity.interceptor.InterceptorDynamicEntityTest;
@@ -500,6 +501,7 @@
suite.addTest( LazyKeyManyToOneTest.suite() );
suite.addTest( EagerKeyManyToOneTest.suite() );
suite.addTest( SQLFunctionsInterSystemsTest.suite() );
+ suite.addTest( SybaseASE15LockHintsTest.suite() );
suite.addTest( SybaseLockHintsTest.suite() );
suite.addTest( SQLServerLockHintsTest.suite() );
suite.addTest( InsertOrderingTest.suite() );
Modified: core/branches/Branch_3_2/test/org/hibernate/test/connections/AggressiveReleaseTest.java
===================================================================
--- core/branches/Branch_3_2/test/org/hibernate/test/connections/AggressiveReleaseTest.java 2009-02-04 23:14:05 UTC (rev 15897)
+++ core/branches/Branch_3_2/test/org/hibernate/test/connections/AggressiveReleaseTest.java 2009-02-05 03:48:51 UTC (rev 15898)
@@ -107,7 +107,7 @@
// expected behavior
}
- // getting the first row only because Sybase throws NullPointerException
+ // getting the first row only because SybaseASE15Dialect throws NullPointerException
// if data is not read before closing the ResultSet
sr.next();
Added: core/branches/Branch_3_2/test/org/hibernate/test/dialect/unit/lockhint/SybaseASE15LockHintsTest.java
===================================================================
--- core/branches/Branch_3_2/test/org/hibernate/test/dialect/unit/lockhint/SybaseASE15LockHintsTest.java (rev 0)
+++ core/branches/Branch_3_2/test/org/hibernate/test/dialect/unit/lockhint/SybaseASE15LockHintsTest.java 2009-02-05 03:48:51 UTC (rev 15898)
@@ -0,0 +1,32 @@
+//$Id $
+package org.hibernate.test.dialect.unit.lockhint;
+
+import junit.framework.TestSuite;
+
+import org.hibernate.dialect.Dialect;
+import org.hibernate.dialect.SybaseASE15Dialect;
+
+/**
+ * {@inheritDoc}
+ *
+ * @author Gail Badner
+ */
+public class SybaseASE15LockHintsTest extends AbstractLockHintTest {
+ public static final Dialect DIALECT = new SybaseASE15Dialect();
+
+ public SybaseASE15LockHintsTest(String string) {
+ super( string );
+ }
+
+ protected String getLockHintUsed() {
+ return "holdlock";
+ }
+
+ protected Dialect getDialectUnderTest() {
+ return DIALECT;
+ }
+
+ public static TestSuite suite() {
+ return new TestSuite( SybaseASE15LockHintsTest.class );
+ }
+}
Modified: core/branches/Branch_3_2/test/org/hibernate/test/generated/TimestampGeneratedValuesWithCachingTest.java
===================================================================
--- core/branches/Branch_3_2/test/org/hibernate/test/generated/TimestampGeneratedValuesWithCachingTest.java 2009-02-04 23:14:05 UTC (rev 15897)
+++ core/branches/Branch_3_2/test/org/hibernate/test/generated/TimestampGeneratedValuesWithCachingTest.java 2009-02-05 03:48:51 UTC (rev 15898)
@@ -5,6 +5,10 @@
import org.hibernate.dialect.Dialect;
import org.hibernate.dialect.SybaseDialect;
+import org.hibernate.dialect.Sybase11Dialect;
+import org.hibernate.dialect.SybaseAnywhereDialect;
+import org.hibernate.dialect.SybaseASE15Dialect;
+import org.hibernate.dialect.SQLServerDialect;
import org.hibernate.junit.functional.FunctionalTestClassTestSuite;
/**
@@ -25,7 +29,9 @@
public boolean appliesTo(Dialect dialect) {
// this test is specific to Sybase/SQLServer as it is testing support
// for their TIMESTAMP datatype...
- return ( dialect instanceof SybaseDialect );
+ return ( dialect instanceof SybaseDialect || dialect instanceof Sybase11Dialect ||
+ dialect instanceof SybaseAnywhereDialect || dialect instanceof SybaseASE15Dialect ||
+ dialect instanceof SQLServerDialect);
}
public static Test suite() {
Modified: core/branches/Branch_3_2/test/org/hibernate/test/hql/ASTParserLoadingTest.java
===================================================================
--- core/branches/Branch_3_2/test/org/hibernate/test/hql/ASTParserLoadingTest.java 2009-02-04 23:14:05 UTC (rev 15897)
+++ core/branches/Branch_3_2/test/org/hibernate/test/hql/ASTParserLoadingTest.java 2009-02-05 03:48:51 UTC (rev 15898)
@@ -33,6 +33,9 @@
import org.hibernate.dialect.PostgreSQLDialect;
import org.hibernate.dialect.SQLServerDialect;
import org.hibernate.dialect.SybaseDialect;
+import org.hibernate.dialect.Sybase11Dialect;
+import org.hibernate.dialect.SybaseASE15Dialect;
+import org.hibernate.dialect.SybaseAnywhereDialect;
import org.hibernate.hql.ast.ASTQueryTranslatorFactory;
import org.hibernate.junit.functional.FunctionalTestCase;
import org.hibernate.junit.functional.FunctionalTestClassTestSuite;
@@ -1218,7 +1221,7 @@
if ( getDialect() instanceof DB2Dialect ) {
assertTrue( str.startsWith("1.234") );
}
- else if ( getDialect() instanceof SybaseDialect ) {
+ else if ( getDialect() instanceof SybaseDialect || getDialect() instanceof Sybase11Dialect || getDialect() instanceof SybaseASE15Dialect || getDialect() instanceof SybaseAnywhereDialect || getDialect() instanceof SQLServerDialect ) {
// str(val) on sybase assumes a default of 10 characters with no decimal point or decimal values
// str(val) on sybase result is right-justified
assertEquals( str.length(), 10 );
@@ -1230,7 +1233,7 @@
else {
assertTrue( str.startsWith("123.4") );
}
- if ( ! ( getDialect() instanceof SybaseDialect ) ) {
+ if ( ! ( getDialect() instanceof SybaseDialect ) && ! ( getDialect() instanceof Sybase11Dialect ) && ! ( getDialect() instanceof SybaseASE15Dialect ) && ! ( getDialect() instanceof SybaseAnywhereDialect ) && ! ( getDialect() instanceof SQLServerDialect ) ) {
// In TransactSQL (the variant spoken by Sybase and SQLServer), the str() function
// is explicitly intended for numeric values only...
String dateStr1 = (String) session.createQuery("select str(current_date) from Animal").uniqueResult();
Modified: core/branches/Branch_3_2/test/org/hibernate/test/hql/HQLTest.java
===================================================================
--- core/branches/Branch_3_2/test/org/hibernate/test/hql/HQLTest.java 2009-02-04 23:14:05 UTC (rev 15897)
+++ core/branches/Branch_3_2/test/org/hibernate/test/hql/HQLTest.java 2009-02-05 03:48:51 UTC (rev 15898)
@@ -19,7 +19,11 @@
import org.hibernate.dialect.MySQLDialect;
import org.hibernate.dialect.Oracle8iDialect;
import org.hibernate.dialect.PostgreSQLDialect;
+import org.hibernate.dialect.SQLServerDialect;
+import org.hibernate.dialect.SybaseAnywhereDialect;
import org.hibernate.dialect.SybaseDialect;
+import org.hibernate.dialect.Sybase11Dialect;
+import org.hibernate.dialect.SybaseASE15Dialect;
import org.hibernate.dialect.function.SQLFunction;
import org.hibernate.engine.SessionFactoryImplementor;
import org.hibernate.engine.query.HQLQueryPlan;
@@ -220,11 +224,14 @@
assertTranslation("from Animal a where abs(:param - a.bodyWeight) < 2.0");
assertTranslation("from Animal where abs(:x - :y) < 2.0");
assertTranslation("from Animal where lower(upper(:foo)) like 'f%'");
- if ( ! ( getDialect() instanceof SybaseDialect ) ) {
- // SybaseDialect maps the length function -> len; classic translator does not consider that *when nested*
+ if ( ! ( getDialect() instanceof SybaseDialect ) && ! ( getDialect() instanceof Sybase11Dialect ) && ! ( getDialect() instanceof SybaseASE15Dialect ) && ! ( getDialect() instanceof SQLServerDialect ) ) {
+ // Transact-SQL dialects (except SybaseAnywhereDialect) map the length function -> len;
+ // classic translator does not consider that *when nested*;
+ // SybaseAnywhereDialect supports the length function
+
assertTranslation("from Animal a where abs(abs(a.bodyWeight - 1.0 + :param) * abs(length('ffobar')-3)) = 3.0");
}
- if ( !( getDialect() instanceof MySQLDialect || getDialect() instanceof SybaseDialect ) ) {
+ if ( !( getDialect() instanceof MySQLDialect ) && ! ( getDialect() instanceof SybaseDialect ) && ! ( getDialect() instanceof Sybase11Dialect ) && !( getDialect() instanceof SybaseASE15Dialect ) && ! ( getDialect() instanceof SybaseAnywhereDialect ) && ! ( getDialect() instanceof SQLServerDialect ) ) {
assertTranslation("from Animal where lower(upper('foo') || upper(:bar)) like 'f%'");
}
if ( getDialect() instanceof PostgreSQLDialect ) {
@@ -595,7 +602,8 @@
}
public void testConcatenation() {
- if ( getDialect() instanceof MySQLDialect || getDialect() instanceof SybaseDialect ) {
+ if ( getDialect() instanceof MySQLDialect || getDialect() instanceof SybaseDialect || getDialect() instanceof Sybase11Dialect || getDialect() instanceof SybaseASE15Dialect || getDialect() instanceof SybaseAnywhereDialect || getDialect() instanceof SQLServerDialect ) {
+ // SybaseASE15Dialect and SybaseAnywhereDialect support '||'
// MySQL uses concat(x, y, z)
// SQL Server replaces '||' with '+'
//
Modified: core/branches/Branch_3_2/test/org/hibernate/test/interfaceproxy/InterfaceProxyTest.java
===================================================================
--- core/branches/Branch_3_2/test/org/hibernate/test/interfaceproxy/InterfaceProxyTest.java 2009-02-04 23:14:05 UTC (rev 15897)
+++ core/branches/Branch_3_2/test/org/hibernate/test/interfaceproxy/InterfaceProxyTest.java 2009-02-05 03:48:51 UTC (rev 15898)
@@ -46,7 +46,7 @@
SecureDocument d2 = new SecureDocumentImpl();
d2.setName("Secret");
d2.setContent( Hibernate.createBlob( "wxyz wxyz".getBytes() ) );
- // Sybase only allows 7-bits in a byte to be inserted into a tinyint
+ // SybaseASE15Dialect only allows 7-bits in a byte to be inserted into a tinyint
// column (0 <= val < 128)
d2.setPermissionBits( (byte) 127 );
d2.setOwner("gavin");
Modified: core/branches/Branch_3_2/test/org/hibernate/test/legacy/FooBarTest.java
===================================================================
--- core/branches/Branch_3_2/test/org/hibernate/test/legacy/FooBarTest.java 2009-02-04 23:14:05 UTC (rev 15897)
+++ core/branches/Branch_3_2/test/org/hibernate/test/legacy/FooBarTest.java 2009-02-05 03:48:51 UTC (rev 15898)
@@ -56,6 +56,8 @@
import org.hibernate.dialect.SAPDBDialect;
import org.hibernate.dialect.SQLServerDialect;
import org.hibernate.dialect.SybaseDialect;
+import org.hibernate.dialect.Sybase11Dialect;
+import org.hibernate.dialect.SybaseASE15Dialect;
import org.hibernate.dialect.TimesTenDialect;
import org.hibernate.engine.SessionFactoryImplementor;
import org.hibernate.jmx.HibernateService;
@@ -2127,7 +2129,8 @@
s.find("select count(*) from Baz as baz where 1 in indices(baz.fooArray)");
s.find("select count(*) from Bar as bar where 'abc' in elements(bar.baz.fooArray)");
s.find("select count(*) from Bar as bar where 1 in indices(bar.baz.fooArray)");
- if ( !(getDialect() instanceof DB2Dialect) && !(getDialect() instanceof Oracle8iDialect ) && !( getDialect() instanceof SybaseDialect && !(getDialect() instanceof SQLServerDialect ) ) ) {
+ if ( !(getDialect() instanceof DB2Dialect) && !(getDialect() instanceof Oracle8iDialect ) && !( getDialect() instanceof SybaseDialect ) && !( getDialect() instanceof Sybase11Dialect ) && !( getDialect() instanceof SybaseASE15Dialect ) ) {
+ // SybaseAnywhereDialect supports implicit conversions from strings to ints
s.find("select count(*) from Bar as bar, bar.component.glarch.proxyArray as g where g.id in indices(bar.baz.fooArray)");
s.find("select max( elements(bar.baz.fooArray) ) from Bar as bar, bar.component.glarch.proxyArray as g where g.id in indices(bar.baz.fooArray)");
}
Modified: core/branches/Branch_3_2/test/org/hibernate/test/legacy/SQLFunctionsTest.java
===================================================================
--- core/branches/Branch_3_2/test/org/hibernate/test/legacy/SQLFunctionsTest.java 2009-02-04 23:14:05 UTC (rev 15897)
+++ core/branches/Branch_3_2/test/org/hibernate/test/legacy/SQLFunctionsTest.java 2009-02-05 03:48:51 UTC (rev 15898)
@@ -24,6 +24,9 @@
import org.hibernate.dialect.MckoiDialect;
import org.hibernate.dialect.MySQLDialect;
import org.hibernate.dialect.SybaseDialect;
+import org.hibernate.dialect.Sybase11Dialect;
+import org.hibernate.dialect.SybaseASE15Dialect;
+import org.hibernate.dialect.SybaseAnywhereDialect;
import org.hibernate.dialect.TimesTenDialect;
import org.hibernate.dialect.SQLServerDialect;
import org.hibernate.dialect.Oracle9iDialect;
@@ -368,7 +371,7 @@
s.find("from Simple s where not( upper( s.name ) ='yada' or 1=2 or 'foo'='bar' or not('foo'='foo') or 'foo' like 'bar' )").size()==1
);
}
- if ( !(getDialect() instanceof MySQLDialect) && !(getDialect() instanceof SybaseDialect) && !(getDialect() instanceof MckoiDialect) && !(getDialect() instanceof InterbaseDialect) && !(getDialect() instanceof TimesTenDialect) ) { //My SQL has a funny concatenation operator
+ if ( !(getDialect() instanceof MySQLDialect) && !(getDialect() instanceof SybaseDialect) && !(getDialect() instanceof SQLServerDialect) && !(getDialect() instanceof MckoiDialect) && !(getDialect() instanceof InterbaseDialect) && !(getDialect() instanceof TimesTenDialect) ) { //My SQL has a funny concatenation operator
assertTrue(
s.find("from Simple s where lower( s.name || ' foo' ) ='simple 1 foo'").size()==1
);
@@ -498,8 +501,8 @@
//assertTrue( b.getClob() instanceof ClobImpl );
s.flush();
- // Sybase ASE does not support ResultSet.getBlob(String)
- if ( getDialect() instanceof SybaseDialect && ! ( getDialect() instanceof SQLServerDialect ) ) {
+ // Sybase does not support ResultSet.getBlob(String)
+ if ( getDialect() instanceof SybaseDialect || getDialect() instanceof Sybase11Dialect || getDialect() instanceof SybaseASE15Dialect || getDialect() instanceof SybaseAnywhereDialect ) {
s.connection().rollback();
s.close();
return;
Modified: core/branches/Branch_3_2/test/org/hibernate/test/lob/SerializableTypeTest.java
===================================================================
--- core/branches/Branch_3_2/test/org/hibernate/test/lob/SerializableTypeTest.java 2009-02-04 23:14:05 UTC (rev 15897)
+++ core/branches/Branch_3_2/test/org/hibernate/test/lob/SerializableTypeTest.java 2009-02-05 03:48:51 UTC (rev 15898)
@@ -30,7 +30,9 @@
import org.hibernate.Session;
import org.hibernate.dialect.Dialect;
import org.hibernate.dialect.SybaseDialect;
-import org.hibernate.dialect.SQLServerDialect;
+import org.hibernate.dialect.Sybase11Dialect;
+import org.hibernate.dialect.SybaseASE15Dialect;
+import org.hibernate.dialect.SybaseAnywhereDialect;
import org.hibernate.junit.functional.FunctionalTestCase;
import org.hibernate.junit.functional.FunctionalTestClassTestSuite;
@@ -59,8 +61,8 @@
}
public void testNewSerializableType() {
- // Sybase ASE does not support ResultSet.getBlob(String)
- if ( getDialect() instanceof SybaseDialect && ! ( getDialect() instanceof SQLServerDialect ) ) {
+ // Sybase dialects do not support ResultSet.getBlob(String)
+ if ( getDialect() instanceof SybaseDialect || getDialect() instanceof Sybase11Dialect || getDialect() instanceof SybaseASE15Dialect || getDialect() instanceof SybaseAnywhereDialect ) {
return;
}
Modified: core/branches/Branch_3_2/test/org/hibernate/test/mixed/MixedTest.java
===================================================================
--- core/branches/Branch_3_2/test/org/hibernate/test/mixed/MixedTest.java 2009-02-04 23:14:05 UTC (rev 15897)
+++ core/branches/Branch_3_2/test/org/hibernate/test/mixed/MixedTest.java 2009-02-05 03:48:51 UTC (rev 15898)
@@ -46,7 +46,7 @@
SecureDocument d2 = new SecureDocument();
d2.setName( "Secret" );
d2.setContent( Hibernate.createBlob( "wxyz wxyz".getBytes() ) );
- // Sybase only allows 7-bits in a byte to be inserted into a tinyint
+ // SybaseASE15Dialect only allows 7-bits in a byte to be inserted into a tinyint
// column (0 <= val < 128)
d2.setPermissionBits( (byte) 127 );
d2.setOwner( "gavin" );
@@ -96,7 +96,7 @@
assertNotNull( d2.getContent() );
assertEquals( "max", d2.getOwner() );
assertEquals( "/", d2.getParent().getName() );
- // Sybase only allows 7-bits in a byte to be inserted into a tinyint
+ // SybaseASE15Dialect only allows 7-bits in a byte to be inserted into a tinyint
// column (0 <= val < 128)
assertEquals( (byte) 127, d2.getPermissionBits() );
assertNotNull( d2.getCreated() );
Modified: core/branches/Branch_3_2/test/org/hibernate/test/stats/StatsTest.java
===================================================================
--- core/branches/Branch_3_2/test/org/hibernate/test/stats/StatsTest.java 2009-02-04 23:14:05 UTC (rev 15897)
+++ core/branches/Branch_3_2/test/org/hibernate/test/stats/StatsTest.java 2009-02-05 03:48:51 UTC (rev 15898)
@@ -165,7 +165,7 @@
// same deal with scroll()...
assertEquals( "unexpected execution count", 3, continentStats.getExecutionCount() );
assertEquals( "unexpected row count", results, continentStats.getExecutionRowCount() );
- // scroll through data because Sybase throws NullPointerException
+ // scroll through data because SybaseASE15Dialect throws NullPointerException
// if data is not read before closing the ResultSet
while ( scrollableResults.next() ) {
// do nothing
More information about the hibernate-commits
mailing list