I don't think EclipseLink is breaking any rules with respect to
supporting @MappedSuperclasson parent classes to Embeddables. Rather it
is a value addfrom a userrequest, see bug:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=283028
It is true though thatembeddable's inheriting from embeddablesis not
supported (it must be done using @MappedSuperclass) and there is an
existing bug for it:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=362183
Feel free to vote for that bugif this functionality is important to you.
Cheers,
Guy
On 01/07/2013 12:55 PM, Dirk Weil wrote:
>
> Hi Christian,
>
> thank you for your answer. I'd like to use inheritance of embeddables
> just in the second scenario, i. e. A extends B and the entity property
> is of type A.
>
> I experienced that EclipseLink does not map the superclass attributes
> unless B ist annotated @MappedSuperclass. Hibernate and openJPA seem
> to map superclass attributes without any special annotation. AFIK
> relates the spec @MappedSuperclass to entity classes only. Is it legal
> to use it on embeddables? Is EclipLink spec-conform?
>
> Thanks and regards
>
> Dirk
>
> *Von:*Christian von Kutzleben [mailto:cvkutzleben_at_versant.com]
> *Gesendet:* Dienstag, 25. Juni 2013 09:59
> *An:* users_at_jpa-spec.java.net
> *Betreff:* [jpa-spec users] Re: Embeddable and inheritance
>
> Hi Dirk,
>
> It depends, what you want to achieve:
>
> JPA targets relational databases and embedded objects don't have
> an identity on their own and are supposed to be mapped to the owners
> table (single refs), or
> the respective tables to be joined to the owners row (col/maps refs).
>
> So polymorphism does not work, if this is, what you wanted to do, then
> the answer would be "no".
>
> If you don't plan to use polymorphism and only derive them for
> convenience, then the answer would be "yes",
> as an Embeddable class adheres to the same rules like an Entity
> (except marked as embeddable rather then entity)
>
> Regards,
>
> Christian
>
> On Mon, Jun 24, 2013 at 11:26 PM, <dirk.weil_at_gedoplan.de
> <mailto:dirk.weil_at_gedoplan.de>> wrote:
>
> Do embeddables allow inheritance, i. e. may an embeddable be derived
> from some other embeddable?
>
> Thanks
> Dirk
>
>
>
>
> --
> Christian von Kutzleben
> Chief Engineer | Versant GmbH
> (T) +49 40 60990-0
> (F) +49 40 60990-113
> (E) cvkutzleben_at_versant.com <mailto:cromberg_at_versant.com>
> www.versant.com <http://www.versant.com> | www.db4o.com
> <http://www.db4o.com>
>
> --
> Versant
> GmbH is incorporated in Germany. Company registration number: HRB
> 54723, Amtsgericht Hamburg. Registered Office: Halenreie 42, 22359
> Hamburg, Germany. Geschäftsführer: Bernhard Wöbker, Volker John
>
> CONFIDENTIALITY
> NOTICE: This e-mail message, including any attachments, is for the sole
> use of the intended recipient(s) and may contain confidential or
> proprietary information. Any unauthorized review, use, disclosure or
> distribution is prohibited. If you are not the intended recipient,
> immediately contact the sender by reply e-mail and destroy all copies of
> the original message.
>
--
Oracle <http://www.oracle.com>
Guy Pelletier
ORACLE Canada, 45 O'Connor Street Suite 400 Ottawa, Ontario Canada K1P 1A4
Green Oracle <http://www.oracle.com/commitment> Oracle is committed to
developing practices and products that help protect the environment