HHH-3672 - Sybase - second(), minute(), hour(), and extract() cause GenericJDBCException

git-svn-id: https://svn.jboss.org/repos/hibernate/core/trunk@15721 1b8cb986-b30d-0410-93ca-fae66ebed9b2
This commit is contained in:
Gail Badner 2008-12-20 00:37:02 +00:00
parent c55e3ac7ef
commit 4e5381eb9f
2 changed files with 5 additions and 5 deletions

View File

@ -43,12 +43,8 @@ public class SQLServerDialect extends SybaseDialect {
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" ) );

View File

@ -88,6 +88,10 @@ public class SybaseDialect extends Dialect {
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) );