Hi, everyone.
I encountered an unexpected change in how Hibernate 7 (7.2.10 Final and 7.3.1 Final) handles the column naming for @Embeddable Entities when using ImplicitNamingStrategyComponentPathImpl in addition to PhysicalNamingStrategySnakeCaseImpl.
Concretely, given
@Entity
public class Contact {
@Id
@GeneratedValue
private UUID id;
@ElementCollection
private Set<Address> addresses = new HashSet<>();
}
and
@Embeddable
public class Address {
private String city;
private String houseNo;
private String postCode;
}
Hibernate 6.6 would create the column addresses_house_no in table contact given the naming strategies referenced above.
Hibernate 7 creates addresses_houseNo instead.
Is this to be expected?
I am aware that I can use @AttributeOverrides in Contact but I’d like to configure it globally. Currently, I work around the behavior by implementing a custom ImplicitNamingStrategy but I wonder this is the correct way or if I found bug.
The change in behavior might come from this fix: commit But I’m not sure this effect was intended.
I pushed my example to a repo: GitHub - bit-bit-bit/hibernate-physical-naming · GitHub .