[ 
https://issues.apache.org/jira/browse/OPENJPA-689?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Richard Zowalla resolved OPENJPA-689.
-------------------------------------
    Resolution: Fixed

Already fixed on master: Sibling entities that share an @Id declared in a 
mapped superclass are tested directly by TestSharedMappedSuperclassIdValue and 
TestMappedSuperclass 
(openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/inheritance).
 Closing.

> @ID define in super class
> -------------------------
>
>                 Key: OPENJPA-689
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-689
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: kernel
>    Affects Versions: 1.1.0
>            Reporter: wilesun
>            Priority: Major
>             Fix For: 1.3.0
>
>
> our entities have share super class,the class has one field define the entity 
> id,so we define the class as mappedsuperclass
> when we work with hibernate JPA,it work fine.
> but migrate to openjpa,the PCEnhancer don't assign other entity has ID 
> class,so the query sql is incorrect.
> example:
> @MappedSuperclass
> public EntityBase {
>     @Id
>     @Column(name="ID")
>     private String id;
> }
> @Entity
> public B extends EntityBase {
> }
> @Entity
> public C extends EntityBase {
> }
> Object o = em.find(B.class, "111");
> the sql list:
> select * from A where id=?
> select * from B where id=?



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to