クラス RepositoryFactoryBeanSupport<T extends Repository<S,ID>,S,ID>
java.lang.ObjectSE
org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport<T,S,ID>
- 型パラメーター:
T
- リポジトリの型。S
- エンティティ型。ID
- エンティティ識別子の型。
- 実装されたすべてのインターフェース:
Aware
、BeanClassLoaderAware
、BeanFactoryAware
、FactoryBean<T>
、InitializingBean
、ApplicationEventPublisherAware
、RepositoryFactoryInformation<S,
ID>
- 既知の直属サブクラス
TransactionalRepositoryFactoryBeanSupport
public abstract class RepositoryFactoryBeanSupport<T extends Repository<S,ID>,S,ID>
extends ObjectSE
implements InitializingBean, RepositoryFactoryInformation<S,ID>, FactoryBean<T>, BeanClassLoaderAware, BeanFactoryAware, ApplicationEventPublisherAware
Spring の
FactoryBean
インターフェース用のアダプター。Spring 構成を介してリポジトリファクトリを簡単にセットアップできます。サブクラスは、ジェネリクスをパススルーしたり、固定ドメインを提供したり、固定識別子型を提供したり、追加のジェネリクス型 パラメーターを提供したりできます。型 パラメーターは、このクラスのものと同じ順序 (リポジトリ型、エンティティ型、識別子型、追加の型 パラメーター) で出現する必要があります。異なる順序を使用すると、無効な型定義になります。
- 作成者:
- Oliver Gierke, Thomas Darimont, Mark Paluch, Johannes Englmeier
フィールドサマリー
インターフェース org.springframework.beans.factory.FactoryBean から継承されたフィールド
OBJECT_TYPE_ATTRIBUTE
コンストラクターのサマリー
コンストラクター修飾子コンストラクター説明protected
RepositoryFactoryBeanSupport
(ClassSE<? extends T> repositoryInterface) 指定されたリポジトリインターフェースの新しいRepositoryFactoryBeanSupport
を作成します。メソッドのサマリー
修飾子と型メソッド説明void
リポジトリを作成する前に、RepositoryFactoryCustomizer
を登録してrepository factor
をカスタマイズします。void
protected OptionalSE<QueryMethodEvaluationContextProvider>
ListableBeanFactory
からデフォルトのQueryMethodEvaluationContextProvider
(またはサブクラス)を作成します。protected abstract RepositoryFactorySupport
実際のRepositoryFactorySupport
インスタンスを作成します。リポジトリファクトリが使用しているEntityInformation
を返します。PersistentEntity<?,
?> 基礎となるリポジトリによって管理されるPersistentEntity
を返します。そのリポジトリに対して宣言されたすべてのQueryMethod
を返します。RepositoryInformation
を返し、使用されているリポジトリに関するメタ情報を判別します。boolean
void
void
setBeanClassLoader
(ClassLoaderSE classLoader) void
setBeanFactory
(BeanFactory beanFactory) void
setCustomImplementation
(ObjectSE customImplementation) Setter は、カスタムリポジトリの実装を挿入します。void
setEvaluationContextProvider
(QueryMethodEvaluationContextProvider evaluationContextProvider) 手動で定義されたクエリで SpEL 式を評価するために使用されるQueryMethodEvaluationContextProvider
を設定します。void
setLazyInit
(boolean lazy) リポジトリプロキシを遅延して初期化するかどうかを構成します。protected void
setMappingContext
(MappingContext<?, ?> mappingContext) void
setNamedQueries
(NamedQueries namedQueries) NamedQueries
インスタンスを挿入する Setter。void
setQueryLookupStrategyKey
(QueryLookupStrategy.Key queryLookupStrategyKey) 使用するQueryLookupStrategy.Key
を設定します。void
setRepositoryBaseClass
(ClassSE<?> repositoryBaseClass) 使用するリポジトリ基本クラスを構成します。void
setRepositoryFragments
(RepositoryComposition.RepositoryFragments repositoryFragments) Setter はリポジトリフラグメントを挿入します。
コンストラクターの詳細
RepositoryFactoryBeanSupport
指定されたリポジトリインターフェースの新しいRepositoryFactoryBeanSupport
を作成します。- パラメーター:
repositoryInterface
- null であってはなりません。
メソッドの詳細
setRepositoryBaseClass
使用するリポジトリ基本クラスを構成します。- パラメーター:
repositoryBaseClass
- 設定する repositoryBaseClass。null でもかまいません。- 導入:
- 1.11
setQueryLookupStrategyKey
使用するQueryLookupStrategy.Key
を設定します。- パラメーター:
queryLookupStrategyKey
-
setCustomImplementation
Setter は、カスタムリポジトリの実装を挿入します。- パラメーター:
customImplementation
-
setRepositoryFragments
Setter はリポジトリフラグメントを挿入します。- パラメーター:
repositoryFragments
-
setNamedQueries
NamedQueries
インスタンスを挿入する Setter。- パラメーター:
namedQueries
- 設定する namedQueries
setMappingContext
- パラメーター:
mappingContext
-
setEvaluationContextProvider
public void setEvaluationContextProvider(QueryMethodEvaluationContextProvider evaluationContextProvider) 手動で定義されたクエリで SpEL 式を評価するために使用されるQueryMethodEvaluationContextProvider
を設定します。- パラメーター:
evaluationContextProvider
- null であってはなりません。
addRepositoryFactoryCustomizer
リポジトリを作成する前に、RepositoryFactoryCustomizer
を登録してrepository factor
をカスタマイズします。- パラメーター:
customizer
- null であってはなりません。- 導入:
- 2.4
setLazyInit
public void setLazyInit(boolean lazy) リポジトリプロキシを遅延して初期化するかどうかを構成します。デフォルトは false です。- パラメーター:
lazy
- リポジトリプロキシを遅延して初期化するかどうか。デフォルトは false です。
setBeanClassLoader
- 次で指定:
- インターフェース
BeanClassLoaderAware
のsetBeanClassLoader
setBeanFactory
- 次で指定:
- インターフェース
BeanFactoryAware
のsetBeanFactory
- 例外:
BeansException
createDefaultQueryMethodEvaluationContextProvider
protected OptionalSE<QueryMethodEvaluationContextProvider> createDefaultQueryMethodEvaluationContextProvider(ListableBeanFactory beanFactory) ListableBeanFactory
からデフォルトのQueryMethodEvaluationContextProvider
(またはサブクラス)を作成します。- パラメーター:
beanFactory
- 使用する Bean ファクトリ。- 戻り値:
- デフォルトのインスタンス。
Optional.empty()
の可能性があります。 - 導入:
- 2.4
setApplicationEventPublisher
- 次で指定:
- インターフェース
ApplicationEventPublisherAware
のsetApplicationEventPublisher
getEntityInformation
インターフェースからコピーされた説明:RepositoryFactoryInformation
リポジトリファクトリが使用しているEntityInformation
を返します。- 次で指定:
- インターフェース
RepositoryFactoryInformation<T extends Repository<S,
のID>, S> getEntityInformation
- 戻り値:
getRepositoryInformation
インターフェースからコピーされた説明:RepositoryFactoryInformation
RepositoryInformation
を返し、使用されているリポジトリに関するメタ情報を判別します。- 次で指定:
- インターフェース
RepositoryFactoryInformation<T extends Repository<S,
のID>, S> getRepositoryInformation
- 戻り値:
getPersistentEntity
インターフェースからコピーされた説明:RepositoryFactoryInformation
基礎となるリポジトリによって管理されるPersistentEntity
を返します。基になる永続化メカニズムがMappingContext
を公開しない場合は、null にすることができます。- 次で指定:
- インターフェース
RepositoryFactoryInformation<T extends Repository<S,
のID>, S> getPersistentEntity
- 戻り値:
getQueryMethods
インターフェースからコピーされた説明:RepositoryFactoryInformation
そのリポジトリに対して宣言されたすべてのQueryMethod
を返します。- 次で指定:
- インターフェース
RepositoryFactoryInformation<T extends Repository<S,
のID>, S> getQueryMethods
- 戻り値:
getObject
- 次で指定:
- インターフェース
FactoryBean<T extends Repository<S,
のID>> getObject
getObjectType
- 次で指定:
- インターフェース
FactoryBean<T extends Repository<S,
のID>> getObjectType
isSingleton
public boolean isSingleton()- 次で指定:
- インターフェース
FactoryBean<T extends Repository<S,
のID>> isSingleton
afterPropertiesSet
public void afterPropertiesSet()- 次で指定:
- インターフェース
InitializingBean
のafterPropertiesSet
createRepositoryFactory
実際のRepositoryFactorySupport
インスタンスを作成します。- 戻り値: