Author: steve.ebersole(a)jboss.com
Date: 2007-10-03 02:17:01 -0400 (Wed, 03 Oct 2007)
New Revision: 14057
Modified:
core/branches/Branch_3_2/src/org/hibernate/dialect/SAPDBDialect.java
Log:
HHH-2822 : added functions for SAPDBDialect
Modified: core/branches/Branch_3_2/src/org/hibernate/dialect/SAPDBDialect.java
===================================================================
--- core/branches/Branch_3_2/src/org/hibernate/dialect/SAPDBDialect.java 2007-10-03
06:16:46 UTC (rev 14056)
+++ core/branches/Branch_3_2/src/org/hibernate/dialect/SAPDBDialect.java 2007-10-03
06:17:01 UTC (rev 14057)
@@ -7,12 +7,13 @@
import org.hibernate.Hibernate;
import org.hibernate.cfg.Environment;
import org.hibernate.dialect.function.NoArgSQLFunction;
+import org.hibernate.dialect.function.SQLFunctionTemplate;
import org.hibernate.dialect.function.StandardSQLFunction;
import org.hibernate.dialect.function.VarArgsSQLFunction;
import org.hibernate.sql.CaseFragment;
import org.hibernate.sql.DecodeCaseFragment;
+import org.hibernate.sql.JoinFragment;
import org.hibernate.sql.OracleJoinFragment;
-import org.hibernate.sql.JoinFragment;
import org.hibernate.util.StringHelper;
/**
@@ -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