I am ashamed to say that the error I received from this question was related to the copy and the entry into the crime.
Despite the fact that in the question code, but in my actual code base, the value of the @Column annotation name in the duplicated addresses 1, 2, 3, and 4 was not changed to be unique.
For example, this is BAD because both @Column values ββare the same for "address_line1"
@Embedded @AttributeOverrides({@AttributeOverride(name = "addressLine", column = @Column(name = "address_line1"))}) private final AddressLine addressLine1; @Embedded @AttributeOverrides({@AttributeOverride(name = "addressLine", column = @Column(name = "address_line1"))}) private final AddressLine addressLine2;
If the names of all columns are unique, this example will work as expected.
source share