Hello,
I have three tables:
Contacts
Persons
Players
Persons extends Contacts, Players extends Persons by identifying relationship (simple shared ID across all tables).
These are my entity classes (relevant parts only):
As you can see the Contact class is abstract, contact entities shouldn't be instantiatable. Persons however should, like players. I execute the following code on an EntityManager:
The first two finds are okay, both return Person instances as expected.
However, the third also returns a Person instance, which is wrong, giving an exception:
What's wrong? Is my code incorrect? Is this an EclipseLink bug?
I'm not sure about it, but shouldn't the working two objects be two different objects? The hashcode displayed hints that these are the same, so maybe my hashCode and equals are wrong?
You can find a standalone JavaSE/HSQLDB SSCE app here:
http://www.kawoolutions.com/media/persons.zip
I'd be glad if anybody could comment on this.
Karsten