[hibernate-issues] [Hibernate-JIRA] Closed: (HHH-6840) Add to_char function to HSQLDialect

Steve Ebersole (JIRA) noreply at atlassian.com
Wed Jan 11 13:13:11 EST 2012


     [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-6840?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Steve Ebersole closed HHH-6840.
-------------------------------


Prepping 4.0.1

> Add to_char function to HSQLDialect
> -----------------------------------
>
>                 Key: HHH-6840
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6840
>             Project: Hibernate Core
>          Issue Type: Improvement
>          Components: query-hql
>    Affects Versions: 3.6.8
>         Environment: Hibernate 3.6.8.Final and HSQLDB 2.2.4
>            Reporter: Roozbeh Maadani
>            Assignee: Steve Ebersole
>            Priority: Minor
>              Labels: dialect, hibernate, hsqldb
>             Fix For: 4.0.1
>
>   Original Estimate: 1h
>          Time Spent: 1m
>  Remaining Estimate: 1h
>
> Hi,
> We are developing a project which uses hibernate 3.6.8.final , Oracle 10g database in production and a in-memory Hsqldb for unittests. In our hql queries, we use "to_char" function which should work both for Oracle 10g and Hsqldb version 2.2 and above. There is no problem in production (Oracle10gDialect) but when we run the tests (for tests we use HSQLDialect ) we get the following mystic error:
> org.hsqldb.HsqlException: user lacks privilege or object not found: TO_CHAR
> And it is possible to see in the logs that HSQLDialect doesn't generate correct sql.
> After tracing the code I found out that HSQLDialect doesn't register "to_char" function for hsqldb 2.2.x. The following code solved the problem:
> public class MyHSQLDialect extends HSQLDialect
> {
>     public MyHSQLDialect()
>     {
>         super();
>         registerFunction( "to_char", new StandardSQLFunction( "to_char" ) );
>     }
> }
> I suppose it is possible to move this code to the HSQLDialect constructor and solve this issue.
> Regards,
> Roozbeh Maadani

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list