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

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

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

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

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

*

* Note that this is basically the same as TxRunnable except that it returns an * Object (and you specify the return type via generics). *

*

* See also {@link TxRunnable}. *

* *
 * Ebean.execute(new TxCallable<String>() {
 *   public String call() {
 *     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);
 * 
 *     return u1.getEmail();
 *   }
 * });
 * 
* * @see TxRunnable */ public interface TxCallable { /** * Execute the method within a transaction scope returning the result. *

* If you do not want to return a result you should look to use TxRunnable * instead. *

*/ T call(); }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy