Examples of TSDetail


Examples of com.avaje.tests.model.basic.TSDetail

    TSMaster m0 = new TSMaster();
    m0.setName("master1");

    Ebean.save(m0);

    m0.addDetail(new TSDetail("master1 detail1"));
    m0.addDetail(new TSDetail("master1 detail2"));

    Ebean.saveAssociation(m0, "details");

    TSMaster m0Check = Ebean.find(TSMaster.class).fetch("details").where().idEq(m0.getId())
        .findUnique();
View Full Code Here

Examples of com.avaje.tests.model.basic.TSDetail

    m0.setId(10000);
    m0.setName("master1");

    Ebean.save(m0);

    TSDetail tsDetail = new TSDetail("master1 detail1");
    tsDetail.setId(10000);
    tsDetail.setMaster(m0);
   
    Ebean.save(tsDetail);

    TSDetail fetchedDetail = Ebean.find(TSDetail.class).setId(10000).fetch("master").findUnique();
   
    Assert.assertNotNull(fetchedDetail);
  }
View Full Code Here

Examples of com.avaje.tests.model.basic.TSDetail

    Ebean.save(master0);
   
    // act
    TSMaster master1 = Ebean.find(master0.getClass(), master0.getId());
   
    TSDetail tsDetail = new TSDetail();
    // Add then remove a bean that was never saved (to the DB)
    master1.getDetails().add(tsDetail);
    master1.getDetails().remove(tsDetail);

    Ebean.save(master1);
View Full Code Here

Examples of com.avaje.tests.model.basic.TSDetail

  public void test() {

    TSMaster m0 = new TSMaster();
    m0.setName("m1");

    m0.addDetail(new TSDetail("m1 detail 1"));
    m0.addDetail(new TSDetail("m1 detail 2"));

    Ebean.save(m0);

    TSMaster master = Ebean.find(TSMaster.class, m0.getId());
    List<TSDetail> details = master.getDetails();

    TSDetail removedDetail = details.remove(1);

    BeanCollection<?> bc = (BeanCollection<?>) details;
    Set<?> modifyRemovals = bc.getModifyRemovals();

    Assert.assertNotNull(modifyRemovals);
View Full Code Here

Examples of com.avaje.tests.model.basic.TSDetail

    Ebean.save(master0);
   
    master1 = Ebean.find(master0.getClass(), master0.getId());
   
    // Add then remove a bean that was never saved (to the DB)
    master1.getDetails().add(new TSDetail());
    master1.getDetails().clear();

    try{
      Ebean.save(master1);
    } catch (OptimisticLockException exception) {
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.