Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 361042 - No primary key attribute in other plug-in project
Summary: No primary key attribute in other plug-in project
Status: NEW
Alias: None
Product: Dali JPA Tools
Classification: WebTools
Component: JPA (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 normal with 3 votes (vote)
Target Milestone: ---   Edit
Assignee: Neil Hauge CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-15 02:55 EDT by Missing name CLA
Modified: 2017-11-14 07:32 EST (History)
6 users (show)

See Also:


Attachments
Example (9.71 KB, application/octet-stream)
2011-10-15 07:25 EDT, Missing name CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Missing name CLA 2011-10-15 02:55:21 EDT
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.
Comment 1 Kentarou Fukuda CLA 2011-10-15 06:20:57 EDT
Hi Kristof,

Would you please provide more details about the bug?

Thanks.
Comment 2 Missing name CLA 2011-10-15 07:25:17 EDT
Created attachment 205247 [details]
Example
Comment 3 Missing name CLA 2011-10-15 07:44:33 EDT
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?
Comment 4 Curtis Windatt CLA 2011-10-17 10:36:08 EDT
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?
Comment 5 Missing name CLA 2012-06-02 12:52:01 EDT
No just the JPA plug-in. The project has only JPA facets.
Comment 6 Curtis Windatt CLA 2012-06-04 09:52:55 EDT
Moving to EclipseLink JPA.
Comment 7 Neil Hauge CLA 2012-07-09 14:39:18 EDT
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.
Comment 8 Anurag Verma CLA 2015-05-11 07:00:44 EDT
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.