If we have a mapping for collection with sequence generator and sequence name parameter {code:xml} <idbag name="emails" cascade="all-delete-orphan" table="person_email"> <collection-id type="long" column="id"> <generator class="sequence"> <param name="sequence_name">seq_person_email_id</param> </generator> </collection-id> <key column="ref_person" /> <many-to-many column="ref_email" class="org.hibernate.sample.Email" /> </idbag> {code} Hibernate ignores the sequence_name parameter.
I guess the issue is in the method org.hibernate.boot.model.source.internal.hbm.ModelBinder.AbstractPluralAttributeSecondPass.bindCollectionIdentifier() which uses org.hibernate.boot.model.source.spi.CollectionIdSource to create org.hibernate.boot.model.IdentifierGeneratorDefinition and the CollectionIdSource only has generator's name.
The attachment contains failing test case. Connection properties for the Oracle database should be set in file '/src/test/resources/unitils-local.properties'.
This feature worked correctly with Hibernate 4.x. |
|