diff --git a/core/src/main/java/org/hibernate/dialect/SQLServerDialect.java b/core/src/main/java/org/hibernate/dialect/SQLServerDialect.java index a9b6cc0295..cef90a9363 100644 --- a/core/src/main/java/org/hibernate/dialect/SQLServerDialect.java +++ b/core/src/main/java/org/hibernate/dialect/SQLServerDialect.java @@ -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" ) ); diff --git a/core/src/main/java/org/hibernate/dialect/SybaseDialect.java b/core/src/main/java/org/hibernate/dialect/SybaseDialect.java index 22cd448bd8..1d706cdfe1 100644 --- a/core/src/main/java/org/hibernate/dialect/SybaseDialect.java +++ b/core/src/main/java/org/hibernate/dialect/SybaseDialect.java @@ -88,7 +88,11 @@ 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) );