HHH-2822 : added functions for SAPDBDialect

git-svn-id: https://svn.jboss.org/repos/hibernate/core/trunk@14056 1b8cb986-b30d-0410-93ca-fae66ebed9b2
This commit is contained in:
Steve Ebersole 2007-10-03 06:16:46 +00:00
parent c74c196e20
commit 6d31022c4a
1 changed files with 10 additions and 0 deletions

View File

@ -9,6 +9,7 @@ import org.hibernate.cfg.Environment;
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 @@ public class SAPDBDialect extends Dialect {
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) );