mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
29 lines
625 B
Java
29 lines
625 B
Java
package io.ebeaninternal.api;
|
|
|
|
import io.ebean.Ebean;
|
|
import io.ebean.TxScope;
|
|
|
|
/**
|
|
* Helper object to make AOP generated code simpler.
|
|
*/
|
|
public class HelpScopeTrans {
|
|
|
|
/**
|
|
* Entering an enhanced transactional method.
|
|
*/
|
|
public static void enter(TxScope txScope) {
|
|
server().scopedTransactionEnter(txScope);
|
|
}
|
|
|
|
/**
|
|
* Exiting an enhanced transactional method.
|
|
*/
|
|
public static void exit(Object returnOrThrowable, int opCode) {
|
|
server().scopedTransactionExit(returnOrThrowable, opCode);
|
|
}
|
|
|
|
private static SpiEbeanServer server() {
|
|
return (SpiEbeanServer) Ebean.getDefaultServer();
|
|
}
|
|
}
|