クラス ExtendedEntityManagerCreator
java.lang.ObjectSE
org.springframework.orm.jpa.ExtendedEntityManagerCreator
「拡張」EntityManagers の JPA 仕様のセマンティクスに従うさまざまな
EntityManagerEE プロキシを作成するためのデリゲート。「拡張」EntityManagers のいくつかのバリアントをサポートします。具体的には、EntityManagerFactory.createEntityManager()EE で定義されている「アプリケーション管理の拡張 EntityManager」と、PersistenceContextType.EXTENDEDEE で定義されている「コンテナー管理の拡張 EntityManager」です。
「アプリケーション管理」と「コンテナー管理」の元々の違いは、「アプリケーション」の場合の EntityManager.joinTransaction()EE メソッドによる外部管理トランザクションの明示的な結合と、"" の各ユーザーレベルの EntityManager 操作での自動結合の必要性でした。コンテナー」ケース。JPA 2.1 以降、どちらの結合モードも両方の種類の EntityManagers で使用できるため、"application-" と "container-managed" の違いは、主に結合モードのデフォルトと、コンテナー管理の EntityManager の制限されたライフサイクルにあります(つまり、注入先のオブジェクトに関連付けられています)。
- 導入:
- 2.0
- 作成者:
- Juergen Hoeller, Rod Johnson, Mark Paluch
- 関連事項:
コンストラクターの概要
コンストラクターメソッドのサマリー
修飾子と型メソッド説明static EntityManagerEEcreateApplicationManagedEntityManager(EntityManagerEE rawEntityManager, EntityManagerFactoryInfo emfInfo) アプリケーション管理の拡張 EntityManager プロキシを作成します。static EntityManagerEEcreateApplicationManagedEntityManager(EntityManagerEE rawEntityManager, EntityManagerFactoryInfo emfInfo, boolean synchronizedWithTransaction) アプリケーション管理の拡張 EntityManager プロキシを作成します。static EntityManagerEEコンテナー管理の拡張 EntityManager プロキシを作成します。static EntityManagerEEcreateContainerManagedEntityManager(EntityManagerFactoryEE emf, MapSE<?, ?> properties) コンテナー管理の拡張 EntityManager プロキシを作成します。static EntityManagerEEcreateContainerManagedEntityManager(EntityManagerFactoryEE emf, MapSE<?, ?> properties, boolean synchronizedWithTransaction) コンテナー管理の拡張 EntityManager プロキシを作成します。static EntityManagerEEcreateContainerManagedEntityManager(EntityManagerEE rawEntityManager, EntityManagerFactoryInfo emfInfo) コンテナー管理の拡張 EntityManager プロキシを作成します。
コンストラクターの詳細
ExtendedEntityManagerCreator
public ExtendedEntityManagerCreator()
メソッドの詳細
createApplicationManagedEntityManager
public static EntityManagerEE createApplicationManagedEntityManager(EntityManagerEE rawEntityManager, EntityManagerFactoryInfo emfInfo) アプリケーション管理の拡張 EntityManager プロキシを作成します。- パラメーター:
rawEntityManager- 飾る生の EntityManageremfInfo- EntityManagerFactoryInfo から JpaDialect および PersistenceUnitInfo を取得する- 戻り値:
- トランザクションに参加できるが、トランザクションには自動的には参加しないアプリケーション管理の EntityManager
createApplicationManagedEntityManager
public static EntityManagerEE createApplicationManagedEntityManager(EntityManagerEE rawEntityManager, EntityManagerFactoryInfo emfInfo, boolean synchronizedWithTransaction) アプリケーション管理の拡張 EntityManager プロキシを作成します。- パラメーター:
rawEntityManager- 飾る生の EntityManageremfInfo- EntityManagerFactoryInfo から JpaDialect および PersistenceUnitInfo を取得するsynchronizedWithTransaction- 進行中のトランザクションに自動的に参加するかどうか (JPA 2.1 SynchronizationType ルールに準拠)- 戻り値:
- トランザクションに参加できるが、トランザクションには自動的には参加しないアプリケーション管理の EntityManager
- 導入:
- 4.0
createContainerManagedEntityManager
public static EntityManagerEE createContainerManagedEntityManager(EntityManagerEE rawEntityManager, EntityManagerFactoryInfo emfInfo) コンテナー管理の拡張 EntityManager プロキシを作成します。- パラメーター:
rawEntityManager- 飾る生の EntityManageremfInfo- EntityManagerFactoryInfo から JpaDialect および PersistenceUnitInfo を取得する- 戻り値:
- マネージドトランザクションに自動的に参加するコンテナー管理の EntityManager
createContainerManagedEntityManager
コンテナー管理の拡張 EntityManager プロキシを作成します。- パラメーター:
emf- EntityManager を作成する EntityManagerFactory。これが EntityManagerFactoryInfo インターフェースを実装する場合、対応する JpaDialect と PersistenceUnitInfo はそれに応じて検出されます。- 戻り値:
- マネージドトランザクションに自動的に参加するコンテナー管理の EntityManager
- 関連事項:
createContainerManagedEntityManager
public static EntityManagerEE createContainerManagedEntityManager(EntityManagerFactoryEE emf, @Nullable MapSE<?, ?> properties) コンテナー管理の拡張 EntityManager プロキシを作成します。- パラメーター:
emf- EntityManager を作成する EntityManagerFactory。これが EntityManagerFactoryInfo インターフェースを実装する場合、対応する JpaDialect と PersistenceUnitInfo はそれに応じて検出されます。properties-createEntityManager呼び出しに渡されるプロパティ (nullの場合があります)- 戻り値:
- マネージドトランザクションに自動的に参加するコンテナー管理の EntityManager
- 関連事項:
createContainerManagedEntityManager
public static EntityManagerEE createContainerManagedEntityManager(EntityManagerFactoryEE emf, @Nullable MapSE<?, ?> properties, boolean synchronizedWithTransaction) コンテナー管理の拡張 EntityManager プロキシを作成します。- パラメーター:
emf- EntityManager を作成する EntityManagerFactory。これが EntityManagerFactoryInfo インターフェースを実装する場合、対応する JpaDialect と PersistenceUnitInfo はそれに応じて検出されます。properties-createEntityManager呼び出しに渡されるプロパティ (nullの場合があります)synchronizedWithTransaction- 進行中のトランザクションに自動的に参加するかどうか (JPA 2.1 SynchronizationType ルールに準拠)- 戻り値:
- コンテナー主導のライフサイクル管理を想定しているが、自動トランザクション同期をオプトアウトする可能性があるコンテナー管理の EntityManager
- 導入:
- 4.0
- 関連事項: