Package com.google.appengine.datanucleus.test.jpa.SingleTableInheritanceJPA

Examples of com.google.appengine.datanucleus.test.jpa.SingleTableInheritanceJPA.ParentIntDiscriminator


  }
  public void testCreateIntDiscriminator_NoTxn() throws Exception {
    testCreateIntDiscriminator(NEW_EM_START_END);
  }
  private void testCreateIntDiscriminator(StartEnd startEnd) throws Exception {
    ParentIntDiscriminator p = new ParentIntDiscriminator();
    p.setParentStr("ParentInt");
    makePersistent(p, startEnd);
   
    String pId = p.getId();
    Key pKey = KeyFactory.stringToKey(pId);
    Entity pe = ds.get(pKey);
   
    Assert.assertEquals(pKey, pe.getKey());
    Assert.assertEquals(1L, pe.getProperty("type"))
View Full Code Here


    cb.setParentStr("C");
    cb.setValue(Boolean.TRUE);
    makePersistent(cb, startEnd);
    String cbId = cb.getId();
   
    ParentIntDiscriminator p = new ParentIntDiscriminator();
    p.setParentStr("B");
    makePersistent(p, startEnd);
    String pId = p.getId();

    startEnd.start();
    Query q = em.createNamedQuery("AllParentIntDiscriminatorObjects");
    List<ParentIntDiscriminator> r = (List<ParentIntDiscriminator>)q.getResultList();
    Assert.assertEquals(3, r.size());
View Full Code Here

  }
  public void testUpdateIntDiscriminator_NoTxn() throws Exception {
    testUpdateIntDiscriminator(NEW_EM_START_END);
  }
  private void testUpdateIntDiscriminator(StartEnd startEnd) throws Exception {
    ParentIntDiscriminator p = new ParentIntDiscriminator();
    p.setParentStr("ParentInt");
    makePersistent(p, startEnd);
   
    String pId = p.getId();
    Key pKey = KeyFactory.stringToKey(pId);
    Assert.assertEquals(PARENTINT_KIND, pKey.getKind());
   
    Entity pe = ds.get(pKey);
    Assert.assertEquals(pKey, pe.getKey());
    Assert.assertEquals(1L, pe.getProperty("type"))
    Assert.assertEquals("ParentInt", pe.getProperty("parentStr"));
    Assert.assertEquals(2, pe.getProperties().size());

    startEnd.start();
    p = em.find(ParentIntDiscriminator.class, pId);
    p.setParentStr("ParentInt(2)");
    startEnd.end();
   
    pe = ds.get(pKey);
    Assert.assertEquals(pKey, pe.getKey());
    Assert.assertEquals(1L, pe.getProperty("type"))
    Assert.assertEquals("ParentInt(2)", pe.getProperty("parentStr"));
    Assert.assertEquals(2, pe.getProperties().size());
   
    startEnd.start();
    p = em.find(ParentIntDiscriminator.class, pId);
    Assert.assertEquals("ParentInt(2)", p.getParentStr());
    startEnd.end();
   
    Assert.assertEquals(1, countForKind(PARENTINT_KIND));
   
    startEnd.start();
View Full Code Here

TOP

Related Classes of com.google.appengine.datanucleus.test.jpa.SingleTableInheritanceJPA.ParentIntDiscriminator

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.