[hibernate-dev] Naming strategies and collection element columns
Gunnar Morling
gunnar at hibernate.org
Fri Jul 17 10:46:23 EDT 2015
Turns out our ImplicitNamingStrategy's determineBasicColumnName() is
invoked twice at different places within Ejb3Column. Once the magic
HHH-6005 replacement takes place (in redefineColumnName()) and the other
time it doesn't (addColumnBinding()).
So we are once called with "grandChildren.name" and the other time
with "grandChildren.collection&&element.name". This seems not right, but
then the code in Ejb3Column is quite dense and I may well miss something.
Any ideas?
2015-07-17 15:11 GMT+02:00 Gunnar Morling <gunnar at hibernate.org>:
> Steve,
>
> There is one remaining itch I have wrt. upgrading OGM to ORM 5.
>
> I have an entity GrandMother with an @ElementCollection "grandChildren" of
> type GrandChild. The latter has a property "name" which used to be passed
> as "grandChildren.collection&&element.name" to OGM's
> NamingStrategy#propertyToColumnName(). We used to detect the
> "collection&&element" pattern to determine the right column name fin OGM.
>
> As of ORM 5, this is passed as "grandChildren.name" instead (due to
> HHH-6005 [1]). Now I thought
> ImplicitBasicColumnNameSource#isCollectionElement() would tell me whether
> this is a collection element, but it returns false in this case.
>
> Shouldn't it return true if the replacement magic for HHH-6005 has kicked
> in Ejb3Column#redefineColumnName()?
>
> Thanks,
>
> --Gunnar
>
> [1] https://hibernate.atlassian.net/browse/HHH-6005
>
>
More information about the hibernate-dev
mailing list