Examples of EmbeddableJPA


Examples of com.google.appengine.datanucleus.test.jpa.EmbeddableJPA

*/
public class JPAEmbeddedTest extends JPATestCase {

  public void testEmbedded() throws EntityNotFoundException {
    HasEmbeddedJPA pojo = new HasEmbeddedJPA();
    EmbeddableJPA embedded = new EmbeddableJPA();
    embedded.setEmbeddedString("yar");
    embedded.setMultiVal(Utils.newArrayList("m1", "m2"));
    pojo.setEmbeddable(embedded);
    embedded = new EmbeddableJPA();
    embedded.setEmbeddedString("yar2");
    embedded.setMultiVal(Utils.newArrayList("m3", "m4"));
    pojo.setEmbeddable2(embedded);
    beginTxn();
    em.persist(pojo);
    commitTxn();
    assertEquals(1, countForClass(HasEmbeddedJPA.class));
View Full Code Here

Examples of com.google.appengine.datanucleus.test.jpa.EmbeddableJPA

    HasEmbeddedJPA pojo = new HasEmbeddedJPA();
    beginTxn();
    em.persist(pojo);
    commitTxn();

    EmbeddableJPA embeddable = new EmbeddableJPA();
    embeddable.setEmbeddedString("yar");
    EmbeddableJPA embeddable2 = new EmbeddableJPA();
    embeddable2.setEmbeddedString("yar2");
    beginTxn();
    pojo.setEmbeddable(embeddable);
    pojo.setEmbeddable2(embeddable2);
    pojo = em.find(HasEmbeddedJPA.class, pojo.getId()); // Finds it in L1 cache from first txn (but with fields set now)
    assertNotNull(pojo.getEmbeddable());
View Full Code Here

Examples of com.google.appengine.datanucleus.test.jpa.EmbeddableJPA

    commitTxn();
  }

  public void testEmbeddedCollectionOfEmbeddables() {
    HasEmbeddableCollection pojo = new HasEmbeddableCollection();
    EmbeddableJPA emb1 = new EmbeddableJPA();
    emb1.setEmbeddedString("The String1");
    pojo.getTheSet().add(emb1);
    EmbeddableJPA emb2 = new EmbeddableJPA();
    emb2.setEmbeddedString("The String2");
    pojo.getTheSet().add(emb2);
    beginTxn();
    em.persist(pojo);
    commitTxn();
    Long pk = pojo.getId();
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.