Author: steve.ebersole(a)jboss.com
Date: 2007-10-03 02:16:46 -0400 (Wed, 03 Oct 2007)
New Revision: 14056
Modified:
core/trunk/core/src/main/java/org/hibernate/dialect/SAPDBDialect.java
Log:
HHH-2822 : added functions for SAPDBDialect
Modified: core/trunk/core/src/main/java/org/hibernate/dialect/SAPDBDialect.java
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/dialect/SAPDBDialect.java 2007-10-03
05:44:41 UTC (rev 14055)
+++ core/trunk/core/src/main/java/org/hibernate/dialect/SAPDBDialect.java 2007-10-03
06:16:46 UTC (rev 14056)
@@ -9,6 +9,7 @@
import org.hibernate.dialect.function.NoArgSQLFunction;
import org.hibernate.dialect.function.StandardSQLFunction;
import org.hibernate.dialect.function.VarArgsSQLFunction;
+import org.hibernate.dialect.function.SQLFunctionTemplate;
import org.hibernate.sql.CaseFragment;
import org.hibernate.sql.DecodeCaseFragment;
import org.hibernate.sql.OracleJoinFragment;
@@ -74,6 +75,15 @@
registerFunction("date", new StandardSQLFunction("date",
Hibernate.DATE) );
registerFunction("microsecond", new
StandardSQLFunction("microsecond", Hibernate.INTEGER) );
+ registerFunction( "second", new SQLFunctionTemplate(Hibernate.INTEGER,
"second(?1)") );
+ registerFunction( "minute", new SQLFunctionTemplate(Hibernate.INTEGER,
"minute(?1)") );
+ registerFunction( "hour", new SQLFunctionTemplate(Hibernate.INTEGER,
"hour(?1)") );
+ registerFunction( "day", new SQLFunctionTemplate(Hibernate.INTEGER,
"day(?1)") );
+ registerFunction( "month", new SQLFunctionTemplate(Hibernate.INTEGER,
"month(?1)") );
+ registerFunction( "year", new SQLFunctionTemplate(Hibernate.INTEGER,
"year(?1)") );
+
+ registerFunction( "extract", new SQLFunctionTemplate(Hibernate.INTEGER,
"?1(?3)") );
+
registerFunction("dayname", new StandardSQLFunction("dayname",
Hibernate.STRING) );
registerFunction("monthname", new StandardSQLFunction("monthname",
Hibernate.STRING) );
registerFunction("dayofmonth", new
StandardSQLFunction("dayofmonth", Hibernate.INTEGER) );
Show replies by date