All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.avaje.ebean.TxRunnable Maven / Gradle / Ivy

There is a newer version: 8.1.1
Show newest version
package com.avaje.ebean;

/**
 * Execute a TxRunnable in a Transaction scope.
 * 

* Use this with the {@link Ebean#execute(TxRunnable)} method. *

*

* See also {@link TxCallable}. *

* *
 * 
 * // this run method runs in a transaction scope
 * // which by default is TxScope.REQUIRED
 * 
 * Ebean.execute(new TxRunnable() {
 *   public void run() {
 *     User u1 = Ebean.find(User.class, 1);
 *     User u2 = Ebean.find(User.class, 2);
 * 
 *     u1.setName("u1 mod");
 *     u2.setName("u2 mod");
 * 
 *     Ebean.save(u1);
 *     Ebean.save(u2);
 *   }
 * });
 * 
* * @see TxCallable */ public interface TxRunnable { /** * Run the method in a transaction sope. */ void run(); }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy