Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] NPE using Embedded ids?

You could remove the @MappedSuperclass annotation then use the @Customizer annotation on BPK to create a Descriptor customizer that adds the mappings for inherited attributes. 

public class MappedSuperClassEmbeddableCustomizer implements DescriptorCustomizer {

    public void customize(ClassDescriptor descriptor) throws Exception {
       
        descriptor.addDirectMapping("<APK.attributeName>", "<getMethodName or null>", "<setMethodName or null>", "<Database Column Name>");

    }

If you want true Embeddable inheritance we can do that too through this customizer but I do not think that is what you are looking for.
--Gordon

konkere wrote:
Guy Pelletier wrote:
  
A class can not be both a mapped superclass and an embeddable.

    
ah yes, hibernate allows that while mentioning in the manual: "The same
notion can be applied to @Embeddable objects to persist properties from
their superclasses. You also need to use @MappedSuperclass to do that (this
should not be considered as a standard EJB3 feature though)".

too bad, gonna go back to using hibernate...
  

Back to the top