2 Replies Latest reply on Jan 31, 2007 4:44 AM by te-bachi

    Composite primary keys

    epbernard

      mappedBy = "rolProceso" => mappedBy = "proceso"

        • 1. Re: Composite primary keys
          ssrinivas

          i have a similar error, but no such mappedBy error.

          i have defined the fetchtype as lazy and i get this error when i try to get the value of isEmpty or iterator.

          the object is detatched. In fact it is serialized out through the local interface. i had initialized the collection data member to an empty array list, but i still get this error. How can i initialize this collection before returning? Please note i do not want to populate the collection yet with all its actual entries.

          i am using jboss with ejb3, but i do not have spring framework. i have seen some postings regarding OpenSessionInViewFilter to be added to web.xml.

          do i have to do that?

          • 2. Re: Composite primary keys
            te-bachi

            either

            @OneToMany(fetch=FetchType.EAGER)
            

            or
            UserTransaction trans = (UserTransaction) ctx.lookup("java:comp/UserTransaction");
            trans.begin();
            
            [...]
            entityManager.createQuery("FROM RolProceso").getResultList();
            [...]
            
            trans.commit();