[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-1930) QuerySyntaxException "with-clause expressions did not reference from-clause element to which the with-clause was associated"

Mike Ressler (JIRA) noreply at atlassian.com
Thu Dec 4 02:00:16 EST 2008


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

Mike Ressler commented on HHH-1930:
-----------------------------------

Spoke too soon.  The generated SQL doesn't include the with clause at all, all my data was messed up:

HQL:
select person, count(data.referenceMe) from model.DataAboutPerson as data right join data.whoImAllAbout as person with (data.referenceMe like 'me%')

SQL:
select person1_.person as col_0_0_, count(dataaboutp0_.referenceme) as col_1_0_, person1_.person as person1_, person1_.name as name1_ from dataaboutperson dataaboutp0_ right outer join people person1_ on dataaboutp0_.person=person1_.person

The ON keyword exists, but the "like 'me%'" information is lost.  Looks like I'll need to dig deeper into the SQL generation code to find where the info is lost.  The log4j debug logs don't seem to be leading me in any particular direction.

Anyone watching this bug that can point me in the right direction in the SQL generation code?  Or anyone that might know the underlying reason why this isn't supported already?

> QuerySyntaxException "with-clause expressions did not reference from-clause element to which the with-clause was associated"
> ----------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HHH-1930
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1930
>             Project: Hibernate Core
>          Issue Type: Bug
>          Components: query-hql
>    Affects Versions: 3.1.3, 3.2.0 cr1, 3.2.0.cr2, 3.2.0.cr3
>            Reporter: Manfred Geiler
>         Attachments: HibernateTestCase.zip
>
>
> In Version 3.1.2 the following "EventManager" HQL query worked fine:
>    select p from Person p join p.emailAddresses as email with email = 'xyz'
> and produced an SQL query like this:
>   select person0_.PERSON_ID as PERSON1_2_, person0_.age as age2_, person0_.firstname as firstname2_, person0_.lastname as lastname2_ 
>    from PERSON person0_ 
>    inner join PERSON_EMAIL_ADDR emailaddre1_ 
>     on person0_.PERSON_ID=emailaddre1_.PERSON_ID and (emailaddre1_.EMAIL_ADDR='xyz')
> From Version 3.1.3 on this HQL throws the following QuerySyntaxException:
> "with-clause expressions did not reference from-clause element to which the with-clause was associated"

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