Community
Participate
Working Groups
Hello When I create an entity with a primary key (generated value) in the first plug-in project and an entity in an other plug-in project, which inherits from the entity in the first project, then i get an error message, that "The entity has no primary key attribute defined". It is possible to create the tables from the entities. But there is always a compile error shown.
Hi Kristof, Would you please provide more details about the bug? Thanks.
Created attachment 205247 [details] Example
In the attachment you will find two projects with test classes. You will see, that even if the ID field exists, the message "The entity has no primary key attribute defined" is shown. (in the problems view) The second thing is, that even if the first class implements the interface Serializable, the second one is created also with this implementation(by the wizard "New Entity"). Is this necessary?
This does not sound like a problem with PDE. What kind of projects are you creating? PDE does not handle primary keys or primary attributes. Are you working with EMF or some other modelling tool?
No just the JPA plug-in. The project has only JPA facets.
Moving to EclipseLink JPA.
You would currently need to list the inherited entity as a class in the persistence.xml to make this work. The listing of this file should not affect your behavior at runtime, but will tell the tooling that a file from an external project needs to be "pulled" into this persistence unit. This is a workaround from the fact that Dali currently supports a 1 persistence.xml, 1 persistence unit per project configuration.
I feel this was fixed, haven't seen in earlier versions of eclipse, but recently migrated to STS 3.6.4 which is build on Eclipse 4.4.2, and I am seeing this one again. & as already mentioned here....adding class to persistence.xml is helping.