Skip to main content

[jpa-spec users] Re: Embeddable and inheritance

  • From: Guy Pelletier <guy.pelletier@...>
  • To: users@...
  • Subject: [jpa-spec users] Re: Embeddable and inheritance
  • Date: Wed, 03 Jul 2013 09:35:07 -0400
  • Organization: Oracle Corporation

<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <font size="-1">I don't think Ec<font size="-1">lipseLink is
        breaking any rules with re<font size="-1">spect to supporting
          @MappedSuperclass<font size="-1"> on parent classes to
            Embeddables<font size="-1"><font size="-1">. Rather <font
                  size="-1">it <font size="-1">is</font></font> a value
                add<font size="-1"><font size="-1"> <font size="-1">from
                      <font size="-1">a</font></font> user<font
                      size="-1"> </font>reque<font size="-1">st<font
                        size="-1">, see bug:
                        <a class="moz-txt-link-freetext" href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=283028";>https://bugs.eclipse.org/bugs/show_bug.cgi?id=283028</a><br>
                        <br>
                        <font size="-1">It is true though that<font
                            size="-1"> embeddable's <font size="-1">inherit<font
                                size="-1">ing from embeddables</font></font><font
                              size="-1"><font size="-1"> is not sup<font
                                  size="-1">ported (i<font size="-1">t
                                    must be done using
                                    @MappedSuperclass) </font>and there
                                  <font size="-1">is an exis<font
                                      size="-1">ting bug for it:<br>
                                      <br>
<a class="moz-txt-link-freetext" href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=362183";>https://bugs.eclipse.org/bugs/show_bug.cgi?id=362183</a><br>
                                      <br>
                                      <font size="-1">Feel free to vote
                                        for that bug<font size="-1"> if
                                          this functionality is <font
                                            size="-1">important to you.<br>
                                            <br>
                                            <font size="-1">Cheers,<br>
                                              <font size="-1">Guy</font></font></font></font></font></font></font></font></font></font></font></font></font></font></font></font></font><font
                size="-1"><font size="-1"><font size="-1"><font
                      size="-1"><br>
                      <br>
                    </font></font></font></font></font></font></font></font></font>
    <div class="moz-cite-prefix">On 01/07/2013 12:55 PM, Dirk Weil
      wrote:<br>
    </div>
    <blockquote cite="mid:00bd01ce767b$d0125380$7036fa80$@gedoplan.de"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html;
        charset=ISO-8859-1">
      <meta name="Generator" content="Microsoft Word 14 (filtered
        medium)">
      <style><!--
/* Font Definitions */
@font-face
	{font-family:Calibri;
	panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
	{font-family:Tahoma;
	panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0cm;
	margin-bottom:.0001pt;
	font-size:12.0pt;
	font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
	{mso-style-priority:99;
	color:blue;
	text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
	{mso-style-priority:99;
	color:purple;
	text-decoration:underline;}
span.E-MailFormatvorlage17
	{mso-style-type:personal-reply;
	font-family:"Calibri","sans-serif";
	color:#1F497D;}
.MsoChpDefault
	{mso-style-type:export-only;
	font-family:"Calibri","sans-serif";
	mso-fareast-language:EN-US;}
@page WordSection1
	{size:612.0pt 792.0pt;
	margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
	{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
      <div class="WordSection1">
        <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"
            lang="EN-US">Hi Christian,<o:p></o:p></span></p>
        <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"
            lang="EN-US"><o:p>&nbsp;</o:p></span></p>
        <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"
            lang="EN-US">thank you for your answer. I&#8217;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.<o:p></o:p></span></p>
        <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"
            lang="EN-US"><o:p>&nbsp;</o:p></span></p>
        <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"
            lang="EN-US">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?<o:p></o:p></span></p>
        <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"
            lang="EN-US"><o:p>&nbsp;</o:p></span></p>
        <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"
            lang="EN-US">Thanks and regards<o:p></o:p></span></p>
        <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"
            lang="EN-US">Dirk<o:p></o:p></span></p>
        <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"
            lang="EN-US"><o:p>&nbsp;</o:p></span></p>
        <p class="MsoNormal"><b><span
style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;"
              lang="EN-US">Von:</span></b><span
style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;"
            lang="EN-US"> Christian von Kutzleben
            [<a class="moz-txt-link-freetext" href="mailto:cvkutzleben@...";>mailto:cvkutzleben@...</a>] <br>
            <b>Gesendet:</b> Dienstag, 25. </span><span
style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;">Juni
            2013 09:59<br>
            <b>An:</b> <a class="moz-txt-link-abbreviated" href="mailto:users@...";>users@...</a><br>
            <b>Betreff:</b> [jpa-spec users] Re: Embeddable and
            inheritance<o:p></o:p></span></p>
        <p class="MsoNormal"><o:p>&nbsp;</o:p></p>
        <p class="MsoNormal" style="margin-bottom:12.0pt">Hi Dirk,<br>
          <br>
          It depends, what you want to achieve:<br>
          <br>
          JPA targets relational databases and embedded objects don't
          have<br>
          an identity on their own and are supposed to be mapped to the
          owners table (single refs), or<br>
          the respective tables to be joined to the owners row (col/maps
          refs).<br>
          <br>
          So polymorphism does not work, if this is, what you wanted to
          do, then the answer would be "no".<br>
          <br>
          If you don't plan to use polymorphism and only derive them for
          convenience, then the answer would be "yes",<br>
          as an Embeddable class adheres to the same rules like an
          Entity (except marked as embeddable rather then entity)<br>
          <br>
          Regards,<br>
          <br>
          Christian<o:p></o:p></p>
        <div>
          <p class="MsoNormal">On Mon, Jun 24, 2013 at 11:26 PM, &lt;<a
              moz-do-not-send="true" href="mailto:dirk.weil@...";
              target="_blank">dirk.weil@...</a>&gt; wrote:<o:p></o:p></p>
          <p class="MsoNormal">Do embeddables allow inheritance, i. e.
            may an embeddable be derived<br>
            from some other embeddable?<br>
            <br>
            Thanks<br>
            Dirk<o:p></o:p></p>
        </div>
        <p class="MsoNormal"><br>
          <br clear="all">
          <br>
          -- <br>
          Christian von Kutzleben<br>
          Chief Engineer | Versant GmbH<br>
          (T) +49 40 60990-0<br>
          (F) +49 40 60990-113<br>
          (E) <a moz-do-not-send="true"
            href="mailto:cromberg@..."; target="_blank">cvkutzleben@...</a><br>
          <a moz-do-not-send="true" href="http://www.versant.com";
            target="_blank">www.versant.com</a> | <a
            moz-do-not-send="true" href="http://www.db4o.com";
            target="_blank">www.db4o.com</a><br>
          <br>
          -- <br>
          Versant<br>
          GmbH is incorporated in Germany. Company registration number:
          HRB<br>
          54723, Amtsgericht Hamburg. Registered Office: Halenreie 42,
          22359<br>
          Hamburg, Germany. Gesch&auml;ftsf&uuml;hrer: Bernhard W&ouml;bker, Volker
          John<br>
          <br>
          CONFIDENTIALITY<br>
          NOTICE: This e-mail message, including any attachments, is for
          the sole<br>
          use of the intended recipient(s) and may contain confidential
          or<br>
          proprietary information. Any unauthorized review, use,
          disclosure or<br>
          distribution is prohibited. If you are not the intended
          recipient,<br>
          immediately contact the sender by reply e-mail and destroy all
          copies of<br>
          the original message.<o:p></o:p></p>
      </div>
    </blockquote>
    <br>
    <div class="moz-signature">-- <br>
      <p>
        <a href="http://www.oracle.com"; target="_blank"><img
            src="cid:part5.07030504.01050308@oracle.com" alt="Oracle"
            height="26" width="114" border="0"></a><br>
        <font face="Verdana, Arial, Helvetica, sans-serif" size="2"
          color="#666666">Guy Pelletier <br>
          <br>
          ORACLE Canada,
          45 O'Connor Street
          Suite 400
          Ottawa, Ontario
          Canada K1P 1A4</font>
        <br>
        <a href="http://www.oracle.com/commitment"; target="_blank"><img
            src="cid:part7.07020104.08000308@oracle.com" alt="Green
            Oracle" height="28" width="44" align="absmiddle" border="0"></a>
        <font face="Verdana, Arial, Helvetica, sans-serif" size="1"
          color="#4B7D42">Oracle is committed to developing practices
          and products that help protect the environment</font>
        <!-- This signature was generated by the MyDesktop Oracle Business Signature utility version 3.9 -->
      </p>
    </div>
  </body>
</html>

GIF image

GIF image



[jpa-spec users] Re: Embeddable and inheritance

Dirk Weil 07/01/2013

[jpa-spec users] Re: Embeddable and inheritance

Guy Pelletier 07/03/2013
 
 
Close
loading
Please Confirm
Close