Examples of InheritanceSub2


Examples of com.alvazan.test.db.InheritanceSub2

    common.setName("dean");
    common.setDiff("diff");
    common.setNum(56);
    mgr.put(common);
   
    InheritanceSub2 toMany = new InheritanceSub2();
    toMany.setDescription("dean");
    toMany.setNum(78);
    toMany.setNumBalls(33);
    mgr.put(toMany);
   
    mgr.flush();
   
    Cursor<KeyValue<InheritanceSub1>> results = InheritanceSub1.findAll(mgr);
View Full Code Here

Examples of com.alvazan.test.db.InheritanceSub2

    common.setName("dean");
    common.setDiff("diff");
    common.setNum(56);
    mgr.put(common);
   
    InheritanceSub2 toMany = new InheritanceSub2();
    toMany.setDescription("dean");
    toMany.setNum(78);
    toMany.setNumBalls(33);
    mgr.put(toMany);
   
    mgr.flush();
   
    InheritanceSub1 result = InheritanceSub1.findByName(mgr, common.getName());
View Full Code Here

Examples of com.alvazan.test.db.InheritanceSub2

    common.setName("xxxx");
    common.setDiff("diff");
    common.setNum(56);
    mgr.put(common);
   
    InheritanceSub2 toMany = new InheritanceSub2();
    toMany.setDescription("werew");
    toMany.setNum(78);
    toMany.setNumBalls(33);
    mgr.put(toMany);
    mgr.flush();
   
    InheritanceSuper abs = mgr.find(InheritanceSuper.class, common.getId());
    Assert.assertTrue(InheritanceSub1.class.isAssignableFrom(abs.getClass()));
    Assert.assertEquals(common.getNum(), abs.getNum());
    Assert.assertEquals(common.getName(), ((InheritanceSub1)abs).getName());
    Assert.assertEquals(common.getDiff(), ((InheritanceSub1)abs).getDiff());
   
    InheritanceSuper many = mgr.find(InheritanceSuper.class, toMany.getId());
    Assert.assertTrue(InheritanceSub2.class.isAssignableFrom(many.getClass()));
    Assert.assertEquals(toMany.getNum(), many.getNum());
    Assert.assertEquals(toMany.getDescription(), ((InheritanceSub2)many).getDescription());
  }
View Full Code Here

Examples of com.alvazan.test.db.InheritanceSub2

    common.setName("xxxx");
    common.setDiff("diff");
    common.setNum(56);
    mgr.put(common);
   
    InheritanceSub2 toMany = new InheritanceSub2();
    toMany.setDescription("werew");
    toMany.setNum(78);
    toMany.setNumBalls(33);
    mgr.put(toMany);
    mgr.flush();
   
    InheritanceSuper abs = mgr.find(InheritanceSuper.class, common.getId());
    Assert.assertTrue(InheritanceSub1.class.isAssignableFrom(abs.getClass()));
    Assert.assertEquals(common.getNum(), abs.getNum());
    Assert.assertEquals(common.getName(), ((InheritanceSub1)abs).getName());
    Assert.assertEquals(common.getDiff(), ((InheritanceSub1)abs).getDiff());
   
    InheritanceSuper many = mgr.find(InheritanceSuper.class, toMany.getId());
    Assert.assertTrue(InheritanceSub2.class.isAssignableFrom(many.getClass()));
    Assert.assertEquals(toMany.getNum(), many.getNum());
    Assert.assertEquals(toMany.getDescription(), ((InheritanceSub2)many).getDescription());
   
    mgr.remove(abs);
    mgr.flush();
    abs = mgr.find(InheritanceSuper.class, common.getId());
    Assert.assertNull(abs);
   
    mgr.remove(many);
    mgr.flush();
    many = mgr.find(InheritanceSuper.class, toMany.getId());
    Assert.assertNull(many);
  }
View Full Code Here

Examples of com.alvazan.test.db.InheritanceSub2

    sub1.setName("xxxx");
    sub1.setDiff("diff");
    sub1.setNum(56);
    mgr.put(sub1);
   
    InheritanceSub2 sub2 = new InheritanceSub2();
    sub2.setLastName("smith");
    sub2.setDescription("werew");
    sub2.setNum(78);
    sub2.setNumBalls(33);
    mgr.put(sub2);
   
    InheritanceToOne ent1 = new InheritanceToOne();
    ent1.setInheritance(sub1);
   
View Full Code Here

Examples of com.alvazan.test.db.InheritanceSub2

    common.setName("xxxx");
    common.setDiff("diff");
    common.setNum(56);
    mgr.put(common);
   
    InheritanceSub2 toMany = new InheritanceSub2();
    toMany.setLastName("smith");
    toMany.setDescription("werew");
    toMany.setNum(78);
    toMany.setNumBalls(33);
    mgr.put(toMany);
   
    InheritanceToMany rel = new InheritanceToMany();
    rel.addEntity(common);
    rel.addEntity(toMany);
    mgr.put(rel);
   
    mgr.flush();
   
    InheritanceToMany newRel = mgr.find(InheritanceToMany.class, rel.getId());
    InheritanceSuper sub1 = newRel.getNameToEntity().get(common.getLastName());
    Assert.assertEquals(common.getId(), sub1.getId());
    Assert.assertEquals(common.getName(), ((InheritanceSub1)sub1).getName());
    Assert.assertEquals(common.getNum(), sub1.getNum());
   
    InheritanceSuper sub2 = newRel.getNameToEntity().get(toMany.getLastName());
    Assert.assertEquals(toMany.getId(), sub2.getId());
    Assert.assertEquals(toMany.getNum(), sub2.getNum());
    Assert.assertEquals(toMany.getDescription(), ((InheritanceSub2)sub2).getDescription());
  }
View Full Code Here

Examples of com.alvazan.test.db.InheritanceSub2

        if (FactorySingleton.getServerType() != DbTypeEnum.CASSANDRA)
            return;

    InheritanceSub1 sub1 = new InheritanceSub1();
    sub1.setName("dean");
    InheritanceSub2 sub2 = new InheritanceSub2();
    sub2.setNum(5);
    Activity act = new Activity();
    act.setId("myid");
    act.setName("joe");
    mgr.put(sub1);
    mgr.put(sub2);
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.