Uploaded image for project: 'OpenJPA'
  1. OpenJPA
  2. OPENJPA-2181

Cascading a persist to a collection of Entities that use IDENTITY generation strategy fails.

    Details

      Description

      I have an Interface (IInterface) and 2 classes that implements that interface (IInterface). Also in another class ( Holder ) I have a collection of interface items ( Collection<IInterface> ).

      When I try to execute the code from OpenJPA_Test.main, in my associated table ( holder_classes), the column which is supposed to hold the references to Class1 or Class2 objects are NULL.

      public class OpenJPA_Test {

      private static HolderDao holderDao = EntityDaoFactory.inst().getHolderDao();

      /**

      • @param args the command line arguments
        */
        public static void main(String[] args) { // TODO code application logic here Holder h = new Holder(); LinkedList<IInterface> list = new LinkedList<IInterface>(); Class1 c1 = new Class1(); Class2 c2 = new Class2(); list.add(c1); list.add(c2); h.setClasses(list); holderDao.create(h); }


        }

        Attachments

        1. src.rar
          7 kB
          Andrei Bratu

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              andreibratu2004@yahoo.com Andrei Bratu
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated: