[hibernate-commits] Hibernate SVN: r15958 - core/branches/Branch_3_3/core/src/main/java/org/hibernate/dialect.

hibernate-commits at lists.jboss.org hibernate-commits at lists.jboss.org
Wed Feb 11 22:48:51 EST 2009


Author: gbadner
Date: 2009-02-11 22:48:51 -0500 (Wed, 11 Feb 2009)
New Revision: 15958

Modified:
   core/branches/Branch_3_3/core/src/main/java/org/hibernate/dialect/SybaseASE15Dialect.java
Log:
HHH-3701 HHH-3640 : Add support for mod, bit_length, and trim to SybaseASE15Dialect


Modified: core/branches/Branch_3_3/core/src/main/java/org/hibernate/dialect/SybaseASE15Dialect.java
===================================================================
--- core/branches/Branch_3_3/core/src/main/java/org/hibernate/dialect/SybaseASE15Dialect.java	2009-02-11 23:54:57 UTC (rev 15957)
+++ core/branches/Branch_3_3/core/src/main/java/org/hibernate/dialect/SybaseASE15Dialect.java	2009-02-12 03:48:51 UTC (rev 15958)
@@ -35,6 +35,7 @@
 import org.hibernate.Hibernate;
 import org.hibernate.LockMode;
 import org.hibernate.cfg.Environment;
+import org.hibernate.dialect.function.AnsiTrimEmulationFunction;
 import org.hibernate.dialect.function.CharIndexFunction;
 import org.hibernate.dialect.function.NoArgSQLFunction;
 import org.hibernate.dialect.function.SQLFunctionTemplate;
@@ -53,6 +54,9 @@
 		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( "mod", new SQLFunctionTemplate( Hibernate.INTEGER, "?1 % ?2" ) );
+		registerFunction( "bit_length", new SQLFunctionTemplate( Hibernate.INTEGER, "datalength(?1) * 8" ) );
+		registerFunction( "trim", new AnsiTrimEmulationFunction( AnsiTrimEmulationFunction.LTRIM, AnsiTrimEmulationFunction.RTRIM, "str_replace" ) ); 
 	}
 
 	// Overridden informational metadata ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~




More information about the hibernate-commits mailing list