Package cat.quickdb.date200912.model

Examples of cat.quickdb.date200912.model.Delete1


    public void testInheritanceQuery(){
        Son2 son = new Son2();
        son.setDescriptionSon("description - son");
        son.setDescription2("description2");
        son.setDescription1("description1");
        Reference2 test = new Reference2();
        test.setValue("value test reference");
        son.setReferenceTest(test);

        Assert.assertTrue(admin.save(son));

        Assert.assertTrue(admin.obtain(son, "referenceTest.value = 'value test reference'"));
View Full Code Here


        Assert.assertEquals("name binding2", bind2.getName());
    }

    @Test
    public void testDeleteParent(){
        Son1 s = new Son1();
        s.setData("data che delete");
        s.setDescription("description of son delete");
        s.setSonName("son name delete");

        Assert.assertTrue(admin.save(s));

        Son1 son = new Son1();
        admin.obtain(son, "data = 'data che delete'");
        Assert.assertEquals("data che delete", son.getData());

        Assert.assertTrue(admin.delete(son));
    }
View Full Code Here

    @Test
    public void testQuerySystemWithInheritance(){
        Reference1 ref = new Reference1();
        ref.setValue("house");

        Son1 son = new Son1();
        son.setData("data from son");
        son.setSonName("child");
        son.setDescription("parent description");
        son.setReference1(ref);

        boolean value = admin.save(son);
        Assert.assertTrue(value);

        Son1 s = new Son1();
        Assert.assertTrue(admin.obtain(s, "reference1.value = 'house'"));
        Assert.assertEquals("house", s.getReference1().getValue());
    }
View Full Code Here

        Assert.assertEquals(2, array4.size());
    }

    @Test
    public void testReferenceNull(){
        Son1 son = new Son1();
        son.setData("son yes");
        son.setSonName("son name yes");
        son.setDescription("parent yes");

        boolean value = admin.save(son);
        Assert.assertTrue(value);

        Son1 s = new Son1();
        Assert.assertTrue(admin.obtain(s, "description = 'parent yes'"));
        Assert.assertEquals("parent yes", s.getDescription());
        Assert.assertEquals(null, s.getReference1());
    }
View Full Code Here

        Assert.assertTrue(admin.delete(test));
    }

    @Test
    public void testInheritanceQuery(){
        Son2 son = new Son2();
        son.setDescriptionSon("description - son");
        son.setDescription2("description2");
        son.setDescription1("description1");
        Reference2 test = new Reference2();
        test.setValue("value test reference");
        son.setReferenceTest(test);

        Assert.assertTrue(admin.save(son));

        Assert.assertTrue(admin.obtain(son, "referenceTest.value = 'value test reference'"));
        Assert.assertEquals("description - son", son.getDescriptionSon());
    }
View Full Code Here

        admin.executeQuery("DROP TABLE Delete1Delete2Delete2");
        admin.executeQuery("DROP TABLE Delete2Delete1Delete1");

        Delete2 d2a2 = new Delete2();
        d2a2.setName("delete2 - prueba1");
        Delete1 d1a2 = new Delete1();
        d1a2.setDescription("delete2-delete1-desc1");
        Delete1 d1b2 = new Delete1();
        d1b2.setDescription("delete2-delete1-desc2");
        ArrayList a1 = new ArrayList();
        a1.add(d1a2);
        a1.add(d1b2);
        d2a2.setDelete1(a1);

        Delete2 d2b2 = new Delete2();
        d2b2.setName("delete2 - prueba2");
        Delete1 d1c2 = new Delete1();
        d1c2.setDescription("delete2-delete1-desc3");
        Delete1 d1d2 = new Delete1();
        d1d2.setDescription("delete2-delete1-desc4");
        ArrayList a2 = new ArrayList();
        a2.add(d1c2);
        a2.add(d1d2);
        d2b2.setDelete1(a2);

        ArrayList array2 = new ArrayList();
        array2.add(d2a2);
        array2.add(d2b2);

        Delete1 d3 = new Delete1();
        d3.setDescription("description delete1");
        d3.setDelete2(array2);

        System.out.println(admin.save(d3));

        System.out.println(admin.obtain(d3, "description = 'description delete1'"));

        ((Delete1) d3.getDelete2().get(0).getDelete1().get(0)).setDescription("new description2");
        ((Delete1) d3.getDelete2().get(1).getDelete1().get(0)).setDescription("description modify2");
        d3.getDelete2().get(0).setName("name modify2");

        Delete2 d2q = new Delete2();
        d2q.setName("delete2 - prueba - added");
        d3.getDelete2().add(d2q);

        System.out.println(admin.modify(d3));
        Delete1 d4 = new Delete1();
        System.out.println(admin.obtain(d4, "description = 'description delete1'"));
        System.out.println("new description2".equalsIgnoreCase(((Delete1)d4.getDelete2().get(0).getDelete1().get(0)).getDescription()));
    }
View Full Code Here

        ArrayList array = new ArrayList();
        array.add(d2a);
        array.add(d2b);

        Delete1 d = new Delete1();
        d.setDescription("description delete1");
        d.setDelete2(array);

        System.out.println(admin.save(d));

        Delete1 d1 = new Delete1();
        System.out.println(admin.obtain(d1, "description = 'description delete1'"));

        System.out.println(admin.delete(d1));
        System.out.println(!admin.obtain(d1, "description = 'description delete1'"));
    }
View Full Code Here

        admin.executeQuery("DROP TABLE Delete1Delete2Delete2");
        admin.executeQuery("DROP TABLE Delete2Delete1Delete1");
       
        Delete2 d2a = new Delete2();
        d2a.setName("delete2 - prueba1");
        Delete1 d1a = new Delete1();
        d1a.setDescription("delete2-delete1-desc1");
        Delete1 d1b = new Delete1();
        d1b.setDescription("delete2-delete1-desc2");
        ArrayList a1 = new ArrayList();
        a1.add(d1a);
        a1.add(d1b);
        d2a.setDelete1(a1);

        Delete2 d2b = new Delete2();
        d2b.setName("delete2 - prueba2");
        Delete1 d1c = new Delete1();
        d1c.setDescription("delete2-delete1-desc3");
        Delete1 d1d = new Delete1();
        d1d.setDescription("delete2-delete1-desc4");
        ArrayList a2 = new ArrayList();
        a2.add(d1c);
        a2.add(d1d);
        d2b.setDelete1(a2);

        ArrayList array = new ArrayList();
        array.add(d2a);
        array.add(d2b);

        Delete1 d = new Delete1();
        d.setDescription("description delete1");
        d.setDelete2(array);

        System.out.println(admin.save(d));

        System.out.println(admin.obtain(d, "description = 'description delete1'"));
        System.out.println(admin.delete(d));
View Full Code Here

TOP

Related Classes of cat.quickdb.date200912.model.Delete1

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.