From 7b727315c54758d0794b7281243d3233e471168b Mon Sep 17 00:00:00 2001 From: Diego Plentz Date: Mon, 28 Apr 2008 04:56:51 +0000 Subject: [PATCH] [HHH-1787] Postgres dialect needs date_trunc git-svn-id: https://svn.jboss.org/repos/hibernate/core/trunk@14584 1b8cb986-b30d-0410-93ca-fae66ebed9b2 --- .../src/main/java/org/hibernate/dialect/PostgreSQLDialect.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/org/hibernate/dialect/PostgreSQLDialect.java b/core/src/main/java/org/hibernate/dialect/PostgreSQLDialect.java index 10866336c4..cc7c1c2363 100644 --- a/core/src/main/java/org/hibernate/dialect/PostgreSQLDialect.java +++ b/core/src/main/java/org/hibernate/dialect/PostgreSQLDialect.java @@ -86,14 +86,15 @@ public class PostgreSQLDialect extends Dialect { registerFunction( "bit_length", new StandardSQLFunction("bit_length", Hibernate.LONG) ); registerFunction( "octet_length", new StandardSQLFunction("octet_length", Hibernate.LONG) ); + registerFunction( "age", new StandardSQLFunction("age") ); registerFunction( "current_date", new NoArgSQLFunction("current_date", Hibernate.DATE, false) ); registerFunction( "current_time", new NoArgSQLFunction("current_time", Hibernate.TIME, false) ); registerFunction( "current_timestamp", new NoArgSQLFunction("current_timestamp", Hibernate.TIMESTAMP, false) ); + registerFunction( "date_trunc", new StandardSQLFunction( "date_trunc", Hibernate.TIMESTAMP ) ); registerFunction( "localtime", new NoArgSQLFunction("localtime", Hibernate.TIME, false) ); registerFunction( "localtimestamp", new NoArgSQLFunction("localtimestamp", Hibernate.TIMESTAMP, false) ); registerFunction( "now", new NoArgSQLFunction("now", Hibernate.TIMESTAMP) ); registerFunction( "timeofday", new NoArgSQLFunction("timeofday", Hibernate.STRING) ); - registerFunction( "age", new StandardSQLFunction("age") ); registerFunction( "current_user", new NoArgSQLFunction("current_user", Hibernate.STRING, false) ); registerFunction( "session_user", new NoArgSQLFunction("session_user", Hibernate.STRING, false) );