We're updating the issue view to help you get more done. 

@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

Components

Fix versions

Affects versions

5.2.4

Priority

Major