Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [dali-dev] IPersistentType.allAttributes() not returning MappedSuperclass attributes?

Tom,

I am not having any luck repeating this problem. I created a project and set 'Discover annotated classes automatically' to true. I added a MappedSuperclass with an Id mapping and an Entity that extends the MappedSuperclass. I am seeing allAttributes() return the Id attribute from the MappedSuperclass. Could you send a test project that shows this problem, or do you have any other clues as to what might be different about your project?

Karen

Tom Mutdosch wrote:

Hi Karen,

Thanks for the quick response. I figured out what the problem actually was - I did not have my MappedSuperclass specified in the persistence.xml in a <class> element. Once I added that to the persistence.xml, the allAttributes() call returned attributes from both the Entity and its MappedSuperclass as I expected.

Do you know if this should be necessary? I don't have the option enabled to restrict looking for entities that are only defined in the Persistence.xml. My Entity is found fine if not listed there; but it seems the Superclass is only "discovered" if listed there.

Thanks
Tom

> Hi Tom,
> It looks to me like you need to call IJpaProject.resynch(). This is used to > calculate defaults and things like the parentPersistentType that are dependent
> on the model being fully initialized.
>
> Karen
_______________________________________________
dali-dev mailing list
dali-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/dali-dev



Back to the top