@NaturalId mapping fails when using a composite natural identifier

Description

When using a composite natural identifier:

1 2 3 @NaturalId @Embedded private PostalCode postalCode;

and generating the schema using hbm2ddl, Hibernate throws the following exception:

1 2 3 4 5 org.hibernate.MappingException: Unable to find column with physical name postalCode in table PostalCarrier at org.hibernate.boot.internal.InFlightMetadataCollectorImpl.getLogicalColumnName(InFlightMetadataCollectorImpl.java:1001) at org.hibernate.boot.internal.InFlightMetadataCollectorImpl.getLogicalColumnName(InFlightMetadataCollectorImpl.java:971) at org.hibernate.cfg.IndexOrUniqueKeySecondPass.doSecondPass(IndexOrUniqueKeySecondPass.java:69)

Environment

None

Status

Assignee

Vlad Mihalcea

Reporter

Vlad Mihalcea

Fix versions

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

backportDecision

None

Components

Affects versions

5.2.4

Priority

Major