From 1eb1957eba4cc04548cb1a4b286bff382cfad4e4 Mon Sep 17 00:00:00 2001 From: Gail Badner Date: Thu, 12 Feb 2009 05:24:31 +0000 Subject: [PATCH] HHH-3701 HHH-3640 : Add support for mod, bit_length, and trim to SybaseASE15Dialect git-svn-id: https://svn.jboss.org/repos/hibernate/core/trunk@15960 1b8cb986-b30d-0410-93ca-fae66ebed9b2 --- .../main/java/org/hibernate/dialect/SybaseASE15Dialect.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/src/main/java/org/hibernate/dialect/SybaseASE15Dialect.java b/core/src/main/java/org/hibernate/dialect/SybaseASE15Dialect.java index 7a7cb1b1f3..6acbcadeeb 100644 --- a/core/src/main/java/org/hibernate/dialect/SybaseASE15Dialect.java +++ b/core/src/main/java/org/hibernate/dialect/SybaseASE15Dialect.java @@ -35,6 +35,7 @@ import java.util.Iterator; 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 @@ public class SybaseASE15Dialect extends AbstractTransactSQLDialect { 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 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~