Package org.apache.art

Examples of org.apache.art.Artist.addToPaintingArray()


        // we are trying to reproduce the bug CAY-213 - relationship modification puts
        // object in a modified state, so later when object is really modified, its
        // snapshot is not retained... in testing this I am leaving some flexibility for
        // the framework to retain a snapshot when it deems appropriate...

        a.addToPaintingArray(context.newObject(Painting.class));
        a.setArtistName("some other name");
        assertNotNull("Snapshot wasn't retained - CAY-213", objectStore
                .getChangesByObjectId()
                .get(a.getObjectId()));
    }
View Full Code Here


        Painting p = ctxt.newObject(Painting.class);
        p.setPaintingTitle("A Painting");
        // converting double to string prevents rounding weirdness...
        p.setEstimatedPrice(new BigDecimal("" + paintingPrice));
        a.addToPaintingArray(p);

        ctxt.commitChanges();
    }

    /**
 
View Full Code Here

        ObjectContext childContext = context.createChildContext();

        Artist a = DataObjectUtils.objectForPK(childContext, Artist.class, 33001);
        Painting p = childContext.newObject(Painting.class);
        p.setPaintingTitle("X");
        a.addToPaintingArray(p);

        childContext.commitChangesToParent();

        childContext.deleteObject(p);
        a.removeFromPaintingArray(p);
View Full Code Here

        Artist childModifiedToMany = ((Painting) objects.get(2)).getToArtist();

        // ensure painting array is fully resolved...
        childModifiedToMany.getPaintingArray().size();
        childModifiedToMany.addToPaintingArray((Painting) objects.get(3));

        blockQueries();

        Painting parentModifiedSimple = null;
        Artist parentModifiedToMany = null;
View Full Code Here

        a.setArtistName("X");
        child.commitChanges();

        Painting p1 = child.newObject(Painting.class);
        p1.setPaintingTitle("P1");
        a.addToPaintingArray(p1);

        Painting p2 = child.newObject(Painting.class);
        p2.setPaintingTitle("P2");
        a.addToPaintingArray(p2);
View Full Code Here

        p1.setPaintingTitle("P1");
        a.addToPaintingArray(p1);

        Painting p2 = child.newObject(Painting.class);
        p2.setPaintingTitle("P2");
        a.addToPaintingArray(p2);

        a.removeFromPaintingArray(p2);

        // this causes an error on commit
        child.deleteObject(p2);
View Full Code Here

        List objects = context.performQuery(new SelectQuery(Artist.class));
        Artist a1 = (Artist) objects.get(0);

        Painting p1 = context.newObject(Painting.class);
        p1.setPaintingTitle("XXX");
        a1.addToPaintingArray(p1);
        a1.resetValidationFlags();
        context.commitChanges();

        assertFalse(a1.isValidateForSaveCalled());
    }
View Full Code Here

        Artist a2 = context.newObject(Artist.class);
        a2.setArtistName("a2");

        Painting p12 = context.newObject(Painting.class);
        p12.setPaintingTitle("p12");
        a2.addToPaintingArray(p12);
        Painting p22 = context.newObject(Painting.class);
        p22.setPaintingTitle("p22");
        a2.addToPaintingArray(p22);

        context.commitChanges();
View Full Code Here

        Painting p12 = context.newObject(Painting.class);
        p12.setPaintingTitle("p12");
        a2.addToPaintingArray(p12);
        Painting p22 = context.newObject(Painting.class);
        p22.setPaintingTitle("p22");
        a2.addToPaintingArray(p22);

        context.commitChanges();

        EJBQLQuery query = new EJBQLQuery(
                "SELECT d FROM Artist d WHERE SIZE(d.paintingArray) = 2");
View Full Code Here

    public void testReadRO1() throws Exception {

        // setup test
        Artist a1 = newArtist();
        Painting p1 = newPainting();
        a1.addToPaintingArray(p1);
        ctxt.commitChanges();

        // do select
        Expression e = ExpressionFactory.matchExp("toArtist", a1);
        SelectQuery q = new SelectQuery("ROPainting", e);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.