[hibernate-dev] [OGM] AssociationPersister.collectionPersister()
Gunnar Morling
gunnar at hibernate.org
Tue Aug 26 04:35:07 EDT 2014
2014-08-25 17:42 GMT+02:00 Emmanuel Bernard <emmanuel at hibernate.org>:
> From what I could look at, AssociationPersister.collectionPersister() +
> inverse() is only called in
> OgmCollectionPersister.updateInverseSideOfAssociationNavigation() and the
> owning side CollectionPersister is provided.
>
> So to answer your question
>
> > is the collection persister passed to
> AssociationPersister#collectionPersister() supposed to always be the one
> from the main side? or the one from the currently processed side of the
> association?
>
> The OgmCollectionPersister only do things if it is on the main side (ie
> not an inverse collection). So only the persister from the main side is
> provided.
Thanks for taking a look!
I found one case where actually an inverse collection persister may be
passed: OgmLoader#getResultSet().
This works atm. as the inverse() flag is not set in this context, also if
this actually is the inverse side of a bi-di association. If I set
inverse() (as it would make sense and which I'd like to do as I need that
info for another purpose), the unexpected persister from the inverse side
cause things to fail. I have a workaround atm. but I think we should change
it to pass the main side persister here as it's expected by the code in
AssociationPersister. WDYT?
--Gunnar
More information about the hibernate-dev
mailing list