| Tentatively scheduling for 5.4 Hibernate already supports defining inheritance within @Embedddable hierarchies using @MapppedSuperclass. E.g., this works:
@MappedSuperclass
class Payment {
...
@Basic
Money getAmount() {
...
}
}
@Embeddable
class CreditCardPayment extends Payment {
...
}
In other words, using the mapping above, the `CreditCardPayment` embeddable is understood to contain the `amount` attribute. However, the following does not currently work:
@Embeddable
class Payment {
...
@Basic
Money getAmount() {
...
}
}
@Embeddable
class CreditCardPayment extends Payment {
...
}
IMO this should work as well. Note that there is a "work around":
@Embeddable
@MappedSuperclass
class Payment {
...
@Basic
Money getAmount() {
...
}
}
@Embeddable
class CreditCardPayment extends Payment {
...
}
|