You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by "Albert Lee (JIRA)" <ji...@apache.org> on 2012/10/09 20:26:03 UTC

[jira] [Updated] (OPENJPA-2254) @OneToOne @Id doesn't work if the id specify @Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)

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

Albert Lee updated OPENJPA-2254:
--------------------------------

    Affects Version/s: 2.2.0
        Fix Version/s:     (was: 2.2.0)
                       2.3.0
    
> @OneToOne @Id doesn't work if the id specify @Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
> -----------------------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-2254
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-2254
>             Project: OpenJPA
>          Issue Type: Bug
>    Affects Versions: 2.2.0
>            Reporter: Romain Manni-Bucau
>             Fix For: 2.3.0
>
>
> here how to reproduce:
> @Entity
> public class A {
>     @Id
>     @OneToOne(cascade = ALL, orphanRemoval = true)
>     private B b;
> ...
> }
> @Entity
> @Inheritance(strategy = InheritanceType.TABLE_PER_CLASS) // doesn't work with this line
> public abstract class B {
>     @Id
>     private String	id;
> ...
> }
> then C is just a B child
> test:
>         em.getTransaction().begin();
>         final C c = new C();
>         c.setId("foo");
>         em.persist(c);
>         final A a= new A();
>         a.setB(c);
>         em.persist(a);
>         em.getTransaction().commit();
>        assertNotNull(em.find(A.class, c.getId()));
> Note: without @Inheritance(strategy = InheritanceType.TABLE_PER_CLASS) it works fine

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira