Examples of TxRunnable


Examples of com.avaje.ebean.TxRunnable

public class TestTextJsonSelfRef extends BaseTestCase {

  @Test
  public void test() {

    Ebean.execute(new TxRunnable() {
      public void run() {

        if (Ebean.find(SelfRefCustomer.class).findRowCount() == 0) {
          SelfRefCustomer c1 = new SelfRefCustomer();
          c1.setName("Foo");
View Full Code Here

Examples of com.avaje.ebean.TxRunnable

  @Test
  public void test() {

    try {
      Ebean.execute(new TxRunnable() {
        public void run() {

          willFail();
        }
      });
View Full Code Here

Examples of com.avaje.ebean.TxRunnable

      Assert.assertEquals(e.getMessage(), "test rollback");
    }
  }

  private void willFail() {
    Ebean.execute(new TxRunnable() {
      public void run() {

        String msg = "test rollback";
        throw new RuntimeException(msg);
View Full Code Here

Examples of com.avaje.ebean.TxRunnable

   
    final AttributeHolder holder = new AttributeHolder();
    holder.add(listAttribute);
   
    try {
      Ebean.execute(new TxRunnable() {
        public void run() {
            //Ebean.currentTransaction().log("-- saving holder first time");
            // Alternatively turn off cascade Persist for this transaction
            //Ebean.currentTransaction().setPersistCascade(false);
          Ebean.save(holder);
View Full Code Here

Examples of com.avaje.ebean.TxRunnable

   
    AuditLog log3 = Ebean.find(AuditLog.class, log.getId());
    Assert.assertEquals("foo2", log3.getDescription());
    Assert.assertEquals("mod0", log3.getModifiedDescription());

    Ebean.execute(new TxRunnable() { 
      public void run() { 
        SqlUpdate update = Ebean.createSqlUpdateupdateDml ) ;
        update.setParameter("desc", "foo3");
        update.setParameter("id", id);
        update.execute();
View Full Code Here

Examples of com.avaje.ebean.TxRunnable

      return;
    }
   
    final ResetBasicData me = new ResetBasicData();
   
    server.execute(new TxRunnable() {
      public void run() {
        me.deleteAll();
        me.insertCountries();
        me.insertProducts();
        me.insertTestCustAndOrders();
View Full Code Here

Examples of com.avaje.ebean.TxRunnable

 
 
 
 
  public void deleteAll() {
    Ebean.execute(new TxRunnable() {
      public void run() {
       
        //Ebean.currentTransaction().setBatchMode(false);
       
        // orm update use bean name and bean properties
View Full Code Here

Examples of com.avaje.ebean.TxRunnable

  }
 
 
  public void insertCountries() {
   
    server.execute(new TxRunnable() {
      public void run() {
        Country c = new Country();
        c.setCode("NZ");
        c.setName("New Zealand");
        server.save(c);
View Full Code Here

Examples of com.avaje.ebean.TxRunnable

  }
 

  public void insertProducts() {
   
    server.execute(new TxRunnable() {
      public void run() {
        Product p = new Product();
        p.setId(1);
        p.setName("Chair");
        p.setSku("C001");
View Full Code Here

Examples of com.avaje.ebean.TxRunnable

    });
  }
 
  public void insertTestCustAndOrders() {

    Ebean.execute(new TxRunnable() {
      public void run() {
        Customer cust1 = insertCustomer("Rob");
        Customer cust2 = insertCustomerNoAddress();
        insertCustomerFiona();
        insertCustomerNoContacts("NocCust");
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.