Package models

Examples of models.LifeCycle.save()


        assertTrue(lc.isNew());
        lc.addFail = false;
       
        lc.addedFail = true;
        try {
            lc.save();
            assertFalse(true);
        } catch (Exception e) {
            // ignore
        }
        assertFalse(lc.isNew());
View Full Code Here


        lc.addedFail = false;
       
        lc.bar = "yy";
        lc.updateFail = true;
        try {
            lc.save();
        } catch (Exception e) {
            // ignore
        }
        LifeCycle lc1 = LifeCycle.q("foo", "bar").get();
        assertFalse(lc1.bar.equals(lc.bar));
View Full Code Here

    @Test
    public void testExceptionsinBatchLifeCycleMethods() {
        LifeCycle lc0 = new LifeCycle();
        lc0.foo = "bar";
        lc0.bar = "order";
        lc0.save();
       
        LifeCycle lc1 = new LifeCycle();
        lc1.foo = "foo";
        lc1.bar = "order";
        lc1.save();
View Full Code Here

        lc0.save();
       
        LifeCycle lc1 = new LifeCycle();
        lc1.foo = "foo";
        lc1.bar = "order";
        lc1.save();
       
        MorphiaQuery q = LifeCycle.q("bar", "order");
        LifeCycle.batchDeleteFail = true;
        try {
            q.delete();
View Full Code Here

    public void testLifeCycle() {
        LifeCycle lc = new LifeCycle();
        lc.foo = "bar";
        lc.bar = "xx";
       
        lc.save();
       
        t("bar", OnAdd.class, 1);
        t("bar", Added.class, 1);
        t("bar2", OnAdd.class, 1);
        t("bar", Object.class, 2);
View Full Code Here

        t("bar", Added.class, 1);
        t("bar2", OnAdd.class, 1);
        t("bar", Object.class, 2);
       
        lc.bar = "yy";
        lc.save();
       
        t("bar", OnAdd.class, 1);
        t("bar", OnUpdate.class, 1);
        t("bar", Updated.class, 1);
        t("bar2", OnUpdate.class, 1);
View Full Code Here

        t("bar", Updated.class, 1);
        t("bar2", OnUpdate.class, 1);
        t("bar", Object.class, 4);
       
        lc.bar = "zz";
        lc.save();
       
        t("bar", OnAdd.class, 1);
        t("bar", OnUpdate.class, 2);
        t("bar", Updated.class, 2);
        t("bar2", OnUpdate.class, 2);
View Full Code Here

    @Test
    public void testBatchDelete() {
        LifeCycle lc0 = new LifeCycle();
        lc0.foo = "bar";
        lc0.bar = "order";
        lc0.save();
       
        LifeCycle lc1 = new LifeCycle();
        lc1.foo = "foo";
        lc1.bar = "order";
        lc1.save();
View Full Code Here

        lc0.save();
       
        LifeCycle lc1 = new LifeCycle();
        lc1.foo = "foo";
        lc1.bar = "order";
        lc1.save();
       
        LifeCycle.q("bar", "order").delete();
       
        t("foobar", OnBatchDelete.class, 2);
        t("foobar", BatchDeleted.class, 2);
View Full Code Here

        lc.foo = "bar";
        lc.bar = "xx";
       
        lc.addFail = true;
        try {
            lc.save();
        } catch (Exception e) {
            // ignore
        }
        assertTrue(lc.isNew());
        lc.addFail = false;
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.