[hibernate-dev] request for feedback/review for patch (HHH-3646): implement Criteria API querying of collection-of-component

David Mansfield hibernate at dm.cobite.com
Thu Dec 11 18:41:01 EST 2008


As stated in that issue, this is a really rough but working
implementation, but since I know next to nothing about hibernate
internals, there are probably some gaping problems there.

So this is a request for feedback/review/comment for that patch, with
the hopes that this can go into an upcoming hibernate release.

Here's the link to the JIRA issue:

http://opensource.atlassian.com/projects/hibernate/browse/HHH-3646

The big question mark for me is the obviously hacky change to
CriteriaJoinWalker.  I don't really understand what the
'consumesEntityAlias' check was trying to achieve, but only by disabling
that check could I get the table alias generated by the translator to be
used for the joins.  

Most of the changes are actually logging/debugging necessary to see how
the changes affect the runtime execution, so they're useful for now.

The core change is in three parts:

1) where we establish the 'entity names' belonging to the criteria, we
used to barf trying to treat a collection-of-component as a
collection-of-entity, so this is worked around by creating a property
lookup that works for component-type, and casing our way around to make
sure we use it as necessary.

2) add the collection spaces to the list of spaces returned by the
translator

3) allow the lookup of the PropertyMapping to work for collection roles
as necessary for all of the getColumns() implementations

I haven't yet tried to approach the 'simple' collection-of-value issue,
so if someone in the know wants to comment on whether that could be an
easy add in or not, that would be great.  I'm willing to do the coding
if someone can give some direction on that front.

Thanks,
David Mansfield
Cobite, INC.





More information about the hibernate-dev mailing list