Package com.avaje.ebean

Examples of com.avaje.ebean.EbeanServer.save()


    EBasicClobNoVer entity = new EBasicClobNoVer();
    entity.setName("test");
    entity.setDescription("initialClobValue");
    EbeanServer server = Ebean.getServer(null);
    server.save(entity);

    String sqlNoClob = "select t0.id c0, t0.name c1 from ebasic_clob_no_ver t0 where t0.id = ?";
    String sqlWithClob = "select t0.id c0, t0.name c1, t0.description c2 from ebasic_clob_no_ver t0 where t0.id = ?";
   
View Full Code Here


    EBasicClobFetchEager entity = new EBasicClobFetchEager();
    entity.setName("test");
    entity.setDescription("initialClobValue");
    EbeanServer server = Ebean.getServer(null);
    server.save(entity);

   
    String expectedSql = "select t0.id c0, t0.name c1, t0.title c2, t0.description c3, t0.last_update c4 from ebasic_clob_fetch_eager t0 where t0.id = ?";
   
    // Clob included in fetch as FetchType.EAGER set by annotation
View Full Code Here

    b.setName("aaa");
    b.getEmbeddable().setDescription("123");

    EbeanServer server = Ebean.getServer(null);
   
    server.save(b);

    Assert.assertNotNull(b.getId());

    // reload object und update the name
    EMain b2 = server.find(EMain.class, b.getId());
View Full Code Here

   
    BeanState beanState = server.getBeanState(b2);
    boolean dirty = beanState.isDirty();
    Assert.assertTrue(dirty);
   
    server.save(b2);

    server.beginTransaction();
    try {
        EMain b3 = server.find(EMain.class, b.getId());
        Assert.assertEquals("ABC", b3.getEmbeddable().getDescription());
View Full Code Here

        server.endTransaction();
    }
    EMain b4 = server.find(EMain.class, b.getId());
    b4.setName("bbb");
    b4.getEmbeddable().setDescription("123");
    server.save(b4);

    EMain b5 = server.find(EMain.class, b.getId());
    Assert.assertEquals("123", b5.getEmbeddable().getDescription());
  }
}
View Full Code Here

      @Override
      public void processBean(int row, String[] lineContent, Customer cust) {

        System.out.println(row + "> " + cust + " " + cust.getBillingAddress());

        server.save(cust.getBillingAddress(), transaction);
        server.save(cust, transaction);
      }

    });
View Full Code Here

      public void processBean(int row, String[] lineContent, Customer cust) {

        System.out.println(row + "> " + cust + " " + cust.getBillingAddress());

        server.save(cust.getBillingAddress(), transaction);
        server.save(cust, transaction);
      }

    });

  }
View Full Code Here

    Assert.assertNotNull(list1);
   
    Foo f = new Foo();
    f.setImportantText("blah");
   
    server.save(f);
   
    ConcreteBar cb = new ConcreteBar();
    cb.setFoo(f);
    server.save(cb);
   
View Full Code Here

   
    server.save(f);
   
    ConcreteBar cb = new ConcreteBar();
    cb.setFoo(f);
    server.save(cb);
   
    List<AbstractBar> list2 = server.find(AbstractBar.class)
    .fetch("foo", "importantText")
    .findList();
 
View Full Code Here

    UTDetail detail3 = new UTDetail("three", 8, 30D);
   
    Transaction txn = ebeanServer.beginTransaction();
    try {
      txn.setBatchMode(true);
      ebeanServer.save(detail1);
      ebeanServer.save(detail2);
      ebeanServer.save(detail3);
      txn.commit();
     
    } finally {
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.