Package org.apache.jackrabbit.ocm.testmodel

Examples of org.apache.jackrabbit.ocm.testmodel.C


            B b = new B();
            b.setB1("b1");
            b.setB2("b2");
            a.setB(b);
           
            C c1 = new C();
            c1.setId("first");
            c1.setName("First Element");
            C c2 = new C();
            c2.setId("second");
            c2.setName("Second Element");
           
            C c3 = new C();
            c3.setId("third");
            c3.setName("Third Element");
           
           
            Collection collection = new ArrayList();
            collection.add(c1);
            collection.add(c2);
View Full Code Here


        B b = new B();
        b.setB1("b1");
        b.setB2("b2");
        a.setB(b);
       
        C c1 = new C();
        c1.setId("first");
        c1.setName("First Element");
        C c2 = new C();
        c2.setId("second");
        c2.setName("Second Element");
       
        C c3 = new C();
        c3.setId("third");
        c3.setName("Third Element");
       
       
        Collection collection = new ArrayList();
        collection.add(c1);
        collection.add(c2);
View Full Code Here

      B b = new B();
      b.setB1("b1");
      b.setB2("b2");
      a.setB(b);
     
      C c1 = new C();
      c1.setId("first");
      c1.setName("First Element");
      C c2 = new C();
      c2.setId("second");
      c2.setName("Second Element");
     
      C c3 = new C();
      c3.setId("third");
      c3.setName("Third Element");
     
     
      Collection collection = new ArrayList();
      collection.add(c1);
      collection.add(c2);
View Full Code Here

        B b = new B();
        b.setB1("b1");
        b.setB2("b2");
        a.setB(b);
       
        C c1 = new C();
        c1.setId("first");
        c1.setName("First Element");
        C c2 = new C();
        c2.setId("second");
        c2.setName("Second Element");
       
        C c3 = new C();
        c3.setId("third");
        c3.setName("Third Element");
       
       
        Collection collection = new ArrayList();
        collection.add(c1);
        collection.add(c2);
View Full Code Here

      B b = new B();
      b.setB1("b1");
      b.setB2("b2");
      a.setB(b);
     
      C c1 = new C();
      c1.setId("first");
      c1.setName("First Element");
      C c2 = new C();
      c2.setId("second");
      c2.setName("Second Element");
     
      C c3 = new C();
      c3.setId("third");
      c3.setName("Third Element");
     
     
      Collection collection = new ArrayList();
      collection.add(c1);
      collection.add(c2);
View Full Code Here

            B b = new B();
            b.setB1("b1");
            b.setB2("b2");
            a.setB(b);
           
            C c1 = new C();
            c1.setId("first");
            c1.setName("First Element");
            C c2 = new C();
            c2.setId("second");
            c2.setName("Second Element");
           
            C c3 = new C();
            c3.setId("third");
            c3.setName("Third Element");
           
           
            Collection collection = new ArrayList();
            collection.add(c1);
            collection.add(c2);
View Full Code Here

            assertNull("a.collection is not null", a.getCollection());
           
            // --------------------------------------------------------------------------------
            // Update the object
            // --------------------------------------------------------------------------------
            C c1 = new C();
            c1.setId("first");
            c1.setName("First Element");
            C c2 = new C();
            c2.setId("second");
            c2.setName("Second Element");
           
            C c3 = new C();
            c3.setId("third");
            c3.setName("Third Element");
           
           
            Collection collection = new ArrayList();
            collection.add(c1);
            collection.add(c2);
View Full Code Here

            // --------------------------------------------------------------------------------
            // Create and store an object graph in the repository
            // --------------------------------------------------------------------------------
            A a = new A();
            a.setPath("/test");
            C c1 = new C();
            c1.setId("first");
            c1.setName("First Element");
            C c2 = new C();
            c2.setId("second");
            c2.setName("Second Element");
           
            C c3 = new C();
            c3.setId("third");
            c3.setName("Third Element");
           
           
            Collection collection = new ArrayList();
            collection.add(c1);
            collection.add(c2);
            collection.add(c3);
           
            a.setCollection(collection);
           
            ocm.insert(a);
            ocm.save();
           
            // --------------------------------------------------------------------------------
            // Get the object
            // --------------------------------------------------------------------------------          
            a = (A) ocm.getObject( "/test");
            assertNotNull("a.collection is null", a.getCollection());
            assertEquals("Incorrect a.collection size", 3, a.getCollection().size());
            assertTrue("Incorrect a.collection", ((C) a.getCollection().iterator().next()).getId().equals("first"));
           
            // --------------------------------------------------------------------------------
            // Update the object
            // --------------------------------------------------------------------------------
            c1 = new C();
            c1.setId("new first");
            c1.setName("First Element");
           
            c2 = new C();
            c2.setId("new second");
            c2.setName("Second Element");
           
            collection = new ArrayList();
            collection.add(c1);
View Full Code Here

            // --------------------------------------------------------------------------------
            // Create and store an object graph in the repository
            // --------------------------------------------------------------------------------
            A a = new A();
            a.setPath("/test");
            C c1 = new C();
            c1.setId("first");
            c1.setName("First Element");
            C c2 = new C();
            c2.setId("second");
            c2.setName("Second Element");
           
            C c3 = new C();
            c3.setId("third");
            c3.setName("Third Element");
           
           
            Collection collection = new ArrayList();
            collection.add(c1);
            collection.add(c2);
            collection.add(c3);
           
            a.setCollection(collection);
           
            ocm.insert(a);
            ocm.save();
           
            // --------------------------------------------------------------------------------
            // Get the object
            // --------------------------------------------------------------------------------          
            a = (A) ocm.getObject( "/test");
            assertNotNull("a.collection is null", a.getCollection());
            assertEquals("Incorrect a.collection size", 3, a.getCollection().size());
            assertEquals("Incorrect a.collection", "first", ((C) a.getCollection().iterator().next()).getId());
           
            // --------------------------------------------------------------------------------
            // Update the object
            // --------------------------------------------------------------------------------
            C c4 = new C();
            c4.setId("Fourth");
            c4.setName("Fourth Element");
               
            collection = new ArrayList();
            collection.add(c1);
            collection.add(c2);
            collection.add(c3);
View Full Code Here

            assertNull("a.collection is not null", a.getCollection());
           
            // --------------------------------------------------------------------------------
            // Update the object
            // --------------------------------------------------------------------------------
            C c1 = new C();
            c1.setId("first");
            c1.setName("First Element");
            C c2 = new C();
            c2.setId("second");
            c2.setName("Second Element");
           
            C c3 = new C();
            c3.setId("third");
            c3.setName("Third Element");
           
           
            Collection collection = new ArrayList();
            collection.add(c1);
            collection.add(c2);
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.ocm.testmodel.C

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.