This is an automated email from the ASF dual-hosted git repository. borinquenkid pushed a commit to branch 8.0.x-hibernate7 in repository https://gitbox.apache.org/repos/asf/grails-core.git
commit e0fadf0ae5efb101ca46b755ab61e4316f8baaad Author: Walter B Duque de Estrada <[email protected]> AuthorDate: Thu Jan 29 10:49:08 2026 -0600 progress --- .../collectionType/BagCollectionType.java | 28 ++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/grails-data-hibernate6/core/src/main/groovy/org/grails/orm/hibernate/cfg/domainbinding/collectionType/BagCollectionType.java b/grails-data-hibernate6/core/src/main/groovy/org/grails/orm/hibernate/cfg/domainbinding/collectionType/BagCollectionType.java new file mode 100644 index 0000000000..c21807a38b --- /dev/null +++ b/grails-data-hibernate6/core/src/main/groovy/org/grails/orm/hibernate/cfg/domainbinding/collectionType/BagCollectionType.java @@ -0,0 +1,28 @@ +package org.grails.orm.hibernate.cfg.domainbinding.collectionType; + +import org.hibernate.MappingException; +import org.hibernate.boot.spi.InFlightMetadataCollector; +import org.hibernate.mapping.Bag; +import org.hibernate.mapping.Collection; +import org.hibernate.mapping.PersistentClass; + +import org.grails.datastore.mapping.model.types.ToMany; +import org.grails.orm.hibernate.cfg.GrailsDomainBinder; + +public class BagCollectionType extends CollectionType { + + public BagCollectionType(GrailsDomainBinder binder) { + super(java.util.Collection.class, binder); + } + + @Override + public Collection create(ToMany property, PersistentClass owner, + String path, InFlightMetadataCollector mappings, String sessionFactoryBeanName) throws MappingException { + Bag coll = new Bag(buildingContext, owner); + coll.setCollectionTable(owner.getTable()); + coll.setTypeName(getTypeName(property)); + binder.bindCollection(property, coll, owner, mappings, path, sessionFactoryBeanName); + return coll; + } + +}
