org.zuena.guiceex.jpa.transaction
クラス TransactionInterceptor

java.lang.Object
  上位を拡張 org.zuena.guiceex.jpa.transaction.TransactionInterceptor
すべての実装されたインタフェース:
Advice, Interceptor, MethodInterceptor

public class TransactionInterceptor
extends Object
implements MethodInterceptor

メソッド呼び出しにインターセプトされるトランザクションサービスを提供します。
@Transactionalへ指定されているTransactionAttributeType に応じたトランザクション処理を行ます。 また、Objectを除くスーパークラスクラスよりサブクラス方向へ継承関係を辿り、 @PersistenceContextを持つ最初のフィールドにのみEntityManagerインスタンスを抽入します。 その為、複数のpersistence-unitのEntityManagerインスタンスを、1つのEntityManagerクライアント のインスタンスで扱う事はできません。
EntityManagerは、@PersistenceContext.unitName()で指定されたユニット用のインスタンスを、 必要に応じて@PersistenceContext.properties()を使用して作成し、直接フィールドに対して抽入します。

導入されたバージョン:
0.9.1

コンストラクタの概要
TransactionInterceptor(TransactionAttributeType type)
           
 
メソッドの概要
 Object invoke(MethodInvocation invocation)
           
 
クラス java.lang.Object から継承されたメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

コンストラクタの詳細

TransactionInterceptor

public TransactionInterceptor(TransactionAttributeType type)
メソッドの詳細

invoke

public Object invoke(MethodInvocation invocation)
              throws Throwable
定義:
インタフェース MethodInterceptor 内の invoke
例外:
Throwable


Copyright © 2007 zuena.org AllRights Reserved.