[hibernate-dev] Naming strategies and collection element columns
Gunnar Morling
gunnar at hibernate.org
Mon Jul 20 01:32:05 EDT 2015
Steve, any ideas regarding the invocation of determineBasicColumnName() for
collection elements?
Thanks,
--Gunnar
2015-07-17 16:46 GMT+02:00 Gunnar Morling <gunnar at hibernate.org>:
> 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