Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] Embeddables and inheritance

Perhaps incorrectly influenced by it. As far as EclipseLink is concerned, what you have modeled is creating an inheritance hierarchy none the less where the spec talks about inheritance solely with entities.  Maybe the @Inheritance is confusing, but the definition of @DiscriminatorColumn and @DiscriminatorValue which are used with inheritance hierarchies talks solely of entities as well. Would you not expect to be able to use these within your model as well?
 
So this (plus the MappedSuperclass definition) likely caused the confusion or interpretation from the spec that embeddables did not inherit from any parent classes.
 
Anyway, thanks for entering the bug, hopefully someone will get to it soon. Like I mentioned earlier however, you can use a descriptor customizer to enable this functionality in the mean time.
 
Cheers,
Guy
 
----- Original Message -----
Sent: Tuesday, August 04, 2009 9:42 AM
Subject: Re: [eclipselink-users] Embeddables and inheritance

On Tue, Aug 4, 2009 at 9:08 AM, Guy Pelletier <guy.pelletier@xxxxxxxxxx> wrote:
I believe the confusion or interpretation may of stemed from the definition of the @Inheritance and @MappedSuperclass
[...]
However, internally Eclipselink can already support those configurations but you have to set them manually using a descriptor customizer. Please enter a bug to have this corrected by the metadata processing.

Hello, Guy; thanks; I'll file a bug.

I admit to being somewhat confused by your response however, which addresses @Inheritance and @MappedSuperclass while I was discussing @Embeddables.  Are you saying that perhaps someone read the wrong part of the specification, or was incorrectly influenced by it, and that's the reason that one @Embeddable doesn't seem to be able to inherit from another?  I ask, because I'm not using the @Inheritance or @MappedSuperclass annotations at all; rather, I have:

@Embeddable
public class EmbeddableParent implements Serializable {
  //...
}

@Embeddable
public class EmbeddableChild extends EmbeddableParent {
  //...
}

@Entity // etc.
public class SomeEntity implements Serializable {
  @Embedded
  private EmbeddableParent foo;
}

@Entity // etc.
public class SomeOtherEntity implements Serializable {
  @Embedded
  private EmbeddableChild bar;
}

...and that causes EclipseLink to fail.

Best,
Laird

Back to the top