[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-3168) 3.2.6 breaks querying by a property of an entity in a collection

Michael Newcomb (JIRA) noreply at atlassian.com
Thu Mar 6 14:48:33 EST 2008


    [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-3168?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_29712 ] 

Michael Newcomb commented on HHH-3168:
--------------------------------------

Query works in 3.2.6 when explicitly specifying inner join...

"select a from A a inner join a.stuff as s with s.name=:name"

So, unless you are going to update section 14.4 where it says "HQL supports two forms of association joining: implicit and explicit" and remove all the collection type supporting code from DotNode.java...

This is a bug...

> 3.2.6 breaks querying by a property of an entity in a collection
> ----------------------------------------------------------------
>
>                 Key: HHH-3168
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3168
>             Project: Hibernate3
>          Issue Type: Bug
>    Affects Versions: 3.2.6
>            Reporter: Michael Newcomb
>            Assignee: Gail Badner
>
> @NamedQuery(name="q", query="select a from A a where a.stuff.name=:name")
> class A
> {
>   @ManyToMany
>   @MapKey(name = "name")
>   @Sort(type = SortType.NATURAL)
>   SortedMap<String, C> stuff;
> }
> class B
> {
>   @Basic
>   String name;
> }
> class C
>   extends B
> {
> }
> Please excuse the brevity of the example (code is not on internet accessible machine), but just dropping in 3.2.6 hibernate3.jar causes an error in DotNode.propertyType is set to the type of 'name' and fails all the checks in resolve() and calls checkLhsIsNotCollection() which fails...
> When looking at the logs...
> 3.2.5:
> [DotNode] dereferenceCollection(): Created...
> [FromReferenceNode] Resolved :  a.stuff -> .
> [DotNode] getDataType() : name -> ...StringType
> [FromReferenceNode] Resolved :  a.stuff.name -> xxx.name
> [HqlSqlBaseWalker] select : finishing up...
> - at this point there is some logs about 'Using FROM fragment' and then it prints another AST tree with something about querySpaces...
> - then it starts to check the next query
> 3.2.6:
> [DotNode] dereferenceCollection(): Created...
> [FromReferenceNode] Resolved :  a.stuff -> .
> [DotNode] getDataType() : name -> ...StringType
> - then it starts to check the next query
> - it is missing all the extra stuff after the 'getDataType() : name -> ...StringType'

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