[hibernate-issues] [Hibernate-JIRA] Created: (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 12:50:34 EST 2008


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


@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