Skip to content

Commit

Permalink
Component has the method implemented.
Browse files Browse the repository at this point in the history
  • Loading branch information
filipelautert committed Sep 21, 2023
1 parent 00680a2 commit ab88e52
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
import liquibase.structure.core.Schema;
import liquibase.structure.core.Table;
import org.hibernate.boot.spi.MetadataImplementor;
import org.hibernate.id.IdentifierGenerator;
import org.hibernate.mapping.Join;
import org.hibernate.generator.Generator;
import org.hibernate.mapping.Component;
import org.hibernate.mapping.Join;
import org.hibernate.mapping.PersistentClass;
import org.hibernate.mapping.RootClass;

Expand Down Expand Up @@ -85,8 +85,9 @@ protected void addTo(DatabaseObject foundObject, DatabaseSnapshot snapshot) thro
Iterator<PersistentClass> classMappings = entityBindings.iterator();
while (classMappings.hasNext()) {
PersistentClass persistentClass = classMappings.next();
if (!persistentClass.isInherited()) {
Generator ig = persistentClass.getIdentifier().createGenerator(
if (!persistentClass.isInherited() && persistentClass.getIdentifier() instanceof Component) {
var component = (Component) persistentClass.getIdentifier();
Generator ig = component.createGenerator(
metadata.getMetadataBuildingOptions().getIdentifierGeneratorFactory(),
database.getDialect(),
(RootClass) persistentClass
Expand Down

0 comments on commit ab88e52

Please sign in to comment.