Gavin King (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
) *created* an issue
Hibernate ORM (
https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiM2EzNjc0ZWJm...
) / Bug (
https://hibernate.atlassian.net/browse/HHH-15625?atlOrigin=eyJpIjoiM2EzNj...
) HHH-15625 (
https://hibernate.atlassian.net/browse/HHH-15625?atlOrigin=eyJpIjoiM2EzNj...
) @AttributeOverride has no effect when an @EmbeddedId inherits its members (
https://hibernate.atlassian.net/browse/HHH-15625?atlOrigin=eyJpIjoiM2EzNj...
)
Issue Type: Bug Affects Versions: 6.1.4 Assignee: Unassigned Components: hibernate-core
Created: 25/Oct/2022 03:57 AM Priority: Major Reporter: Gavin King (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
)
For this mapping:
@Embeddable
class PostalCode {
@Column(name="country_code")
String countryCode;
@Column(name="zip_code")
int zipCode;
}
@Embeddable
class TownCode extends PostalCode {
String town;
}
@Entity
class Town {
@AttributeOverride(name = "countryCode",
column=@Column(name="town_country_code"))
@AttributeOverride(name = "zipCode",
column=@Column(name="town_zip_code"))
@EmbeddedId
TownCode townCode;
}
The {{@AttributeOverride}}s simply have no effect.
Moving countryCode and zipCode down to the subclass TownCode fixes the problem.
Surely this must be very easy to fix.
(
https://hibernate.atlassian.net/browse/HHH-15625#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-15625#add-comment?atlOrigin=ey...
)
Get Jira notifications on your phone! Download the Jira Cloud app for Android (
https://play.google.com/store/apps/details?id=com.atlassian.android.jira....
) or iOS (
https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=Em...
) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100209- sha1:9aa9d1d )