Package siena.base.test.model

Examples of siena.base.test.model.AggregateParentModel


    }
   
    AggregateChildModel eve = new AggregateChildModel();
    eve.name = "eve";

    AggregateParentModel god = new AggregateParentModel();
    god.name = "god";
    god.child.set(eve);
    god.children.asList().addAll(adams);
       
    god.insert();
   
    assertNotNull(god.id);
    assertNotNull(god.child.get().id);
   
    // get aggregated one2many
    AggregateParentModel godbis = AggregateParentModel.all().filter("name", "god").get();
    List<AggregateChildModel> children_26_36 = godbis.children.asQuery().fetch(10, 26);
    for(int i=0; i<10; i++){
      assertEquals(adams.get(i+26), children_26_36.get(i));     
    }
   
View Full Code Here


    }
   
    AggregateChildModel eve = new AggregateChildModel();
    eve.name = "eve";

    AggregateParentModel god = new AggregateParentModel();
    god.name = "god";
    god.child.set(eve);
    god.children.asList().addAll(adams);
       
    god.insert();
   
    assertNotNull(god.id);
    assertNotNull(god.child.get().id);
   
    // get aggregated one2many
    AggregateParentModel godbis = AggregateParentModel.all().filter("name", "god").get();
    List<AggregateChildModel> children = godbis.children.asQuery().fetchKeys();
    for(int i=0; i<100; i++){
      assertEquals(adams.get(i).id, children.get(i).id);     
      assertTrue(children.get(i).name == null);     
    }
View Full Code Here

    }
   
    AggregateChildModel eve = new AggregateChildModel();
    eve.name = "eve";

    AggregateParentModel god = new AggregateParentModel();
    god.name = "god";
    god.child.set(eve);
    god.children.asList().addAll(adams);
       
    god.insert();
   
    assertNotNull(god.id);
    assertNotNull(god.child.get().id);
   
    // get aggregated one2many
    AggregateParentModel godbis = AggregateParentModel.all().filter("name", "god").get();
    List<AggregateChildModel> children = godbis.children.asQuery().fetchKeys(10);
    for(int i=0; i<10; i++){
      assertEquals(adams.get(i).id, children.get(i).id);     
      assertTrue(children.get(i).name == null);     
    }
View Full Code Here

    }
   
    AggregateChildModel eve = new AggregateChildModel();
    eve.name = "eve";

    AggregateParentModel god = new AggregateParentModel();
    god.name = "god";
    god.child.set(eve);
    god.children.asList().addAll(adams);
       
    god.insert();
   
    assertNotNull(god.id);
    assertNotNull(god.child.get().id);
   
    // get aggregated one2many
    AggregateParentModel godbis = AggregateParentModel.all().filter("name", "god").get();
    List<AggregateChildModel> children = godbis.children.asQuery().fetchKeys(10, 26);
    for(int i=0; i<10; i++){
      assertEquals(adams.get(i+26).id, children.get(i).id);     
      assertTrue(children.get(i).name == null);     
    }
View Full Code Here

    }
   
    AggregateChildModel eve = new AggregateChildModel();
    eve.name = "eve";

    AggregateParentModel god = new AggregateParentModel();
    god.name = "god";
    god.child.set(eve);
    god.children.asList().addAll(adams);
       
    god.insert();
   
    assertNotNull(god.id);
    assertNotNull(god.child.get().id);
   
    // get aggregated one2many
    AggregateParentModel godbis = AggregateParentModel.all().filter("name", "god").get();
    int nb = godbis.children.asQuery().delete();
    assertEquals(100, nb);     
    assertTrue( godbis.children.asList().isEmpty());     
   
    assertTrue( godbis.children.asQuery().fetch().isEmpty());     
View Full Code Here

    }
   
    AggregateChildModel eve = new AggregateChildModel();
    eve.name = "eve";

    AggregateParentModel god = new AggregateParentModel();
    god.name = "god";
    god.child.set(eve);
    god.children.asList().addAll(adams);
       
    god.insert();
   
    assertNotNull(god.id);
    assertNotNull(god.child.get().id);
   
    // get aggregated one2many
    AggregateParentModel godbis = AggregateParentModel.all().filter("name", "god").get();
    assertEquals( adams.get(0), godbis.children.asQuery().get());     
    assertEquals( adams.get(0), godbis.children.asList().get(0));     
    assertEquals( adams.get(0), godbis.children.asQuery().get());     

  }
View Full Code Here

    }
   
    AggregateChildModel eve = new AggregateChildModel();
    eve.name = "eve";

    AggregateParentModel god = new AggregateParentModel();
    god.name = "god";
    god.child.set(eve);
    god.children.asList().addAll(adams);
       
    god.insert();
   
    assertNotNull(god.id);
    assertNotNull(god.child.get().id);
   
    // get aggregated one2many
    AggregateParentModel godbis = AggregateParentModel.all().filter("name", "god").get();
    assertEquals( adams.size(), godbis.children.asQuery().count());     
    assertEquals( adams.size(), godbis.children.asList().size());     
    assertEquals( adams.size(), godbis.children.asQuery().count());     

  }
View Full Code Here

    }
   
    AggregateChildModel eve = new AggregateChildModel();
    eve.name = "eve";

    AggregateParentModel god = new AggregateParentModel();
    god.name = "god";
    god.child.set(eve);
    god.children.asList().addAll(adams);
       
    god.insert();
   
    assertNotNull(god.id);
    assertNotNull(god.child.get().id);
   
    AggregateParentModel godbis = AggregateParentModel.all().filter("name", "god").get();
    AggregateChildModel adam47 = godbis.children.asQuery().filter("name", "adam47").get();
    assertEquals( adams.get(47), adam47);   

    List<AggregateChildModel> adamsbis =
      godbis.children.asQuery().filter("name>", "adam47").filter("name<", "adam5").fetch();
View Full Code Here

    }
   
    AggregateChildModel eve = new AggregateChildModel();
    eve.name = "eve";

    AggregateParentModel god = new AggregateParentModel();
    god.name = "god";
    god.child.set(eve);
    god.children.asList().addAll(adams);
       
    god.insert();
   
    assertNotNull(god.id);
    assertNotNull(god.child.get().id);
   
    AggregateParentModel godbis = AggregateParentModel.all().filter("name", "god").get();

    List<AggregateChildModel> adamsbis =
      godbis.children.asQuery().filter("name>=", "adam41").filter("name<=", "adam49").order("-name").fetch();
    assertEquals( adams.get(49), adamsbis.get(0));   
    assertEquals( adams.get(48), adamsbis.get(1));   
View Full Code Here

TOP

Related Classes of siena.base.test.model.AggregateParentModel

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.