[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-5265) @Formula adds a this_. prefix to an SQL function

Matthias Bosshard (JIRA) noreply at atlassian.com
Thu Dec 23 10:46:05 EST 2010


    [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-5265?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=39423#action_39423 ] 

Matthias Bosshard commented on HHH-5265:
----------------------------------------

I finally found the problem. If there is a white-space between ISNULL and the ( than isFunction method in the Template class returns a false.
So when I remove the spaces it works for me now. But it should working with and without white-spaces.

> @Formula adds a this_. prefix to an SQL function
> ------------------------------------------------
>
>                 Key: HHH-5265
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5265
>             Project: Hibernate Core
>          Issue Type: Bug
>          Components: annotations, core
>    Affects Versions: 3.5.2
>         Environment: Hibernate 3.5.2, with a SQL Anywhere 10 and the org.hibernate.dialect.SybaseDialect
>            Reporter: Matthias Bosshard
>
> With Hibernate 3.5.2 the ISNULL/COALESCE SQL statement in the following @Formula is prefixed with a this_. An so its no valid SQL.
> The annotation:
> @Formula( "(SELECT ISNULL ( (SELECT 1 WHERE EXISTS (SELECT * FROM org.usertable as user WHERE user.user_id = user_id)), 0))" )
> The SQL part for this formula:
> (SELECT *this_.ISNULL* ( (SELECT 1 WHERE EXISTS (SELECT * FROM                            org.usertable as user WHERE user.user_id = this_.user_id)), 0)) as formula8_1_,
> -> thats invalid SQL
> In Hibernate 3.5.1 the SQL is pretty the same, but without this_. before ISNULL.
> (SELECT *ISNULL* ( (SELECT 1 WHERE EXISTS (SELECT * FROM org.usertable as user WHERE user.user_id = this_.user_id)), 0)) as formula8_1_,

-- 
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