We're updating the issue view to help you get more done. 

Correct "to_char" function in HSQL

Description

From :

I believe(have tried) we have incorrectly registered TO_CHAR in HSQL dialect:

org.hibernate.dialect.HSQLDialect:
registerFunction( "to_char", new StandardSQLFunction( "to_char" ) );

while org.hibernate.dialect.Oracle8iDialect:
registerFunction( "to_char", new StandardSQLFunction("to_char",StandardBasicTypes.STRING) );

We're comparing a TO_CHAR construct that gets a Calendar as parameter to a String. The TO_CHAR converts the Calendar to a String, making it possible to compare it with a String. For me it looks like Hibernate
doesn't get that TO_CHAR makes that conversion and only sees that there's a Calendar (within the TO_CHAR) on the left hand side and a String parameter on the right hand side and decides (erroneously I think) that a comparison between the two is invalid.

Environment

None

Status

Assignee

Brett Meyer

Reporter

Brett Meyer

Fix versions

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Priority

Major