diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/mapping/CompositeIdentifierMapping.java b/hibernate-core/src/main/java/org/hibernate/metamodel/mapping/CompositeIdentifierMapping.java index 91d1c4bd62..32a67ecb78 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/mapping/CompositeIdentifierMapping.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/mapping/CompositeIdentifierMapping.java @@ -14,7 +14,7 @@ import org.hibernate.engine.spi.IdentifierValue; * * @author Andrea Boriero */ -public interface CompositeIdentifierMapping extends EntityIdentifierMapping { +public interface CompositeIdentifierMapping extends EntityIdentifierMapping, EmbeddableValuedModelPart { @Override default IdentifierValue getUnsavedStrategy() { diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/mapping/internal/EmbeddedForeignKeyDescriptor.java b/hibernate-core/src/main/java/org/hibernate/metamodel/mapping/internal/EmbeddedForeignKeyDescriptor.java index e74c877a5e..74f31946e2 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/mapping/internal/EmbeddedForeignKeyDescriptor.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/mapping/internal/EmbeddedForeignKeyDescriptor.java @@ -63,6 +63,27 @@ public class EmbeddedForeignKeyDescriptor implements ForeignKeyDescriptor { private final AssociationKey associationKey; private final boolean hasConstraint; + public EmbeddedForeignKeyDescriptor( + String keyTable, + SelectableMappings keySelectableMappings, + EmbeddableValuedModelPart keyMappingType, + String targetTable, + SelectableMappings targetSelectableMappings, + EmbeddableValuedModelPart targetMappingType, + boolean hasConstraint, + MappingModelCreationProcess creationProcess) { + this( + keyMappingType, + targetMappingType, + keyTable, + keySelectableMappings, + targetTable, + targetSelectableMappings, + hasConstraint, + creationProcess + ); + } + public EmbeddedForeignKeyDescriptor( EmbeddableValuedModelPart keyMappingType, EmbeddableValuedModelPart targetMappingType, diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/mapping/internal/ManyToManyCollectionPart.java b/hibernate-core/src/main/java/org/hibernate/metamodel/mapping/internal/ManyToManyCollectionPart.java index 37a4f67e9f..1815c99cac 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/mapping/internal/ManyToManyCollectionPart.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/mapping/internal/ManyToManyCollectionPart.java @@ -9,7 +9,6 @@ package org.hibernate.metamodel.mapping.internal; import java.util.Locale; import java.util.function.Consumer; -import org.hibernate.NotYetImplementedFor6Exception; import org.hibernate.annotations.NotFoundAction; import org.hibernate.dialect.Dialect; import org.hibernate.engine.spi.SharedSessionContractImplementor; @@ -24,6 +23,7 @@ import org.hibernate.mapping.Value; import org.hibernate.metamodel.mapping.AssociationKey; import org.hibernate.metamodel.mapping.BasicEntityIdentifierMapping; import org.hibernate.metamodel.mapping.BasicValuedModelPart; +import org.hibernate.metamodel.mapping.CompositeIdentifierMapping; import org.hibernate.metamodel.mapping.EmbeddableValuedModelPart; import org.hibernate.metamodel.mapping.EntityAssociationMapping; import org.hibernate.metamodel.mapping.EntityIdentifierMapping; @@ -34,6 +34,7 @@ import org.hibernate.metamodel.mapping.ModelPartContainer; import org.hibernate.metamodel.mapping.PluralAttributeMapping; import org.hibernate.metamodel.mapping.SelectableConsumer; import org.hibernate.metamodel.mapping.SelectableMapping; +import org.hibernate.metamodel.mapping.SelectableMappings; import org.hibernate.metamodel.mapping.VirtualModelPart; import org.hibernate.persister.collection.BasicCollectionPersister; import org.hibernate.persister.collection.CollectionPersister; @@ -53,6 +54,8 @@ import org.hibernate.sql.ast.tree.predicate.Predicate; import org.hibernate.type.EntityType; import static java.util.Objects.requireNonNullElse; +import static org.hibernate.metamodel.mapping.internal.MappingModelCreationHelper.createInverseModelPart; +import static org.hibernate.metamodel.mapping.internal.MappingModelCreationHelper.getPropertyOrder; /** * Entity-valued collection-part mapped through a join table. Models both