[hibernate-issues] [Hibernate-JIRA] Created: (HHH-2822) timestamp extraction functions do not work in SAPDBDialect
Yossi Tamari (JIRA)
noreply at atlassian.com
Sun Sep 2 11:03:14 EDT 2007
timestamp extraction functions do not work in SAPDBDialect
----------------------------------------------------------
Key: HHH-2822
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2822
Project: Hibernate3
Issue Type: Bug
Components: query-hql
Affects Versions: 3.2.5, 3.2.4.sp1, 3.2.4, 3.2.3, 3.2.2, 3.2.1, 3.2.0.ga, 3.2.0.cr5, 3.2.0.cr4, 3.2.0.cr3, 3.2.0.cr2, 3.2.0 cr1, 3.1.3, 3.2.0.alpha2, 3.2.0.alpha1, 3.1.2, 3.1.1, 3.1, 3.1 rc3, 3.1 rc2, 3.1 rc 1, 3.1 beta 2, 3.1 beta 1, 3.0.5, 3.0.4, 3.0.3, 3.0.2, 3.0.1, 3.0 final, 3.0 rc 1, 3.0 beta 4, 3.0 beta 3, 3.0 beta 2, 3.0 beta 1, 3.0 alpha
Environment: SAPDB 7.6
Reporter: Yossi Tamari
Priority: Minor
There is no registerFunction in the SAPDBDialect for the date extraction SQL functions (extract, day, hour...). Therefore, the inherited registration from Dialect are in effect. However, they all map to extract, which is no supported in SAPDB.
The correct implementation is to register the following functions in SAPDBDialect.java:
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)") );
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the hibernate-issues
mailing list