timestamp extraction functions for SAPDBDialect

Description

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)") );

Environment

SAPDB 7.6

Activity

Show:
Steve Ebersole
October 3, 2007, 8:17 AM

3.2/trunk

Assignee

Steve Ebersole

Reporter

Yossi Tamari

Fix versions

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Priority

Minor
Configure