クラス MappingRelationalConverter
java.lang.ObjectSE
org.springframework.data.relational.core.conversion.AbstractRelationalConverter
org.springframework.data.relational.core.conversion.MappingRelationalConverter
- 実装されたすべてのインターフェース:
Aware
、ApplicationContextAware
、RelationalConverter
public class MappingRelationalConverter
extends AbstractRelationalConverter
implements ApplicationContextAware
- 導入:
- 3.2
- 作成者:
- Mark Paluch, Jens Schauder, Chirag Tailor, Vincent Galloy, Chanhyeong Cho
- 関連事項:
ネストされたクラスのサマリー
ネストされたクラス修飾子と型クラス説明protected static interface
AggregatePath
の値を取得するためのMappingRelationalConverter.RelationalPropertyValueProvider
拡張機能。protected static interface
行ドキュメントのグラフトラバーサルベースの変換のためのインターフェースを定義する変換コンテキスト。protected static class
protected static final class
PropertyValueProvider
は、プロパティに存在する場合に SpEL 式を評価するか、構成されたソースRowDocument
のフィールドに単にアクセスします。protected class
関連エンティティからのマッピングメタデータルールを適用するMappingRelationalConverter.ConversionContext
の射影バリアント。protected static interface
プロパティ値が存在するかどうかをレポートし、プロパティのコンテキストでの射影 マッピングなどの特定の動作のインスタンスをコンテキスト化できる拡張ParameterValueProvider
。コンストラクターのサマリー
コンストラクターコンストラクター説明新しいRelationalMappingContext
を指定して、新しいMappingRelationalConverter
を作成します。MappingRelationalConverter
(RelationalMappingContext context, CustomConversions conversions) メソッドのサマリー
修飾子と型メソッド説明<T> T
createInstance
(PersistentEntity<T, RelationalPersistentProperty> entity, FunctionSE<Parameter<?, RelationalPersistentProperty>, ObjectSE> parameterValueProvider) ParameterValueProvider
を指定してPersistentEntity
の新しいインスタンスを作成し、コンストラクタープロパティを取得します。protected <R> R
doReadProjection
(MappingRelationalConverter.ConversionContext context, RowDocument document, EntityProjection<R, ?> projection) 新しいMappingRelationalConverter.ConversionContext
を作成します。protected ObjectSE
getPotentiallyConvertedSimpleRead
(ObjectSE value, TypeInformation<?> type) 指定された単純なオブジェクトにカスタム変換があるかどうかを確認します。getPropertyAccessor
(PersistentEntity<T, ?> persistentEntity, T instance) instance
のプロパティ値にアクセスするには、PersistentPropertyAccessor
を返します。<M,
D> EntityProjection<M, D> introspectProjection
(ClassSE<M> resultType, ClassSE<D> entityType) entity type
SE のコンテキストで指定されたresult type
SE をイントロスペクトし、返された型が射影であるかどうか、またその射影にどのようなプロパティパスが参加しているかどうかを調べます。protected <R> MappingRelationalConverter.ProjectingConversionContext
newProjectingConversionContext
(EntityProjection<R, ?> projection) newValueProvider
(RowDocumentAccessor documentAccessor, SpELExpressionEvaluator evaluator, MappingRelationalConverter.ConversionContext context) <R> R
project
(EntityProjection<R, ?> projection, RowDocument document) 射影をRowDocument
に適用し、射影の戻り値の型R
を返します。<R> R
read
(ClassSE<R> type, RowDocument source) RowDocument
をリクエストされたaggregate type
SE に読み取ります。protected <S> S
read
(TypeInformation<S> type, RowDocument source) protected <S> S
readAggregate
(MappingRelationalConverter.ConversionContext context, RowDocumentAccessor documentAccessor, TypeInformation<? extends S> typeHint) document
からオブジェクトを実体化するための変換メソッド。protected <S> S
readAggregate
(MappingRelationalConverter.ConversionContext context, RowDocument document, TypeInformation<? extends S> typeHint) document
からオブジェクトを実体化するための変換メソッド。protected ObjectSE
readCollectionOrArray
(MappingRelationalConverter.ConversionContext context, CollectionSE<?> source, TypeInformation<?> targetType) 指定されたCollection
SE を指定されたTypeInformation
のコレクションに読み取ります。readMap
(MappingRelationalConverter.ConversionContext context, MapSE<?, ?> source, TypeInformation<?> targetType) readValue
(ObjectSE value, TypeInformation<?> type) 関係値を目的のdestination type
に読み取ります。void
setApplicationContext
(ApplicationContext applicationContext) writeValue
(ObjectSE value, TypeInformation<?> type) プロパティ値を、ネイティブに格納できるリレーショナル型に書き込みます。クラス org.springframework.data.relational.core.conversion.AbstractRelationalConverter から継承されたメソッド
getConversions, getConversionService, getEntityInstantiators, getMappingContext
コンストラクターの詳細
MappingRelationalConverter
新しいRelationalMappingContext
を指定して、新しいMappingRelationalConverter
を作成します。- パラメーター:
context
- null であってはなりません。
MappingRelationalConverter
- パラメーター:
context
- null であってはなりません。conversions
- null であってはなりません。
メソッドの詳細
setApplicationContext
- 次で指定:
- インターフェース
ApplicationContextAware
のsetApplicationContext
- 例外:
BeansException
getConversionContext
新しいMappingRelationalConverter.ConversionContext
を作成します。getPropertyAccessor
public <T> PersistentPropertyPathAccessor<T> getPropertyAccessor(PersistentEntity<T, ?> persistentEntity, T instance) インターフェースからコピーされた説明:RelationalConverter
instance
のプロパティ値にアクセスするには、PersistentPropertyAccessor
を返します。- 次で指定:
- インターフェース
RelationalConverter
のgetPropertyAccessor
- パラメーター:
persistentEntity
- 操作するエンティティの種類。null
であってはなりません。instance
- 操作するインスタンス。null
であってはなりません。- 戻り値:
null
ではないことが保証されています。
introspectProjection
public <M,D> EntityProjection<M,D> introspectProjection(ClassSE<M> resultType, ClassSE<D> entityType) インターフェースからコピーされた説明:RelationalConverter
entity type
SE のコンテキストで指定されたresult type
SE をイントロスペクトし、返された型が射影であるかどうか、またその射影にどのようなプロパティパスが参加しているかどうかを調べます。- 次で指定:
- インターフェース
RelationalConverter
のintrospectProjection
- パラメーター:
resultType
- 射影する型。null であってはなりません。entityType
- ソースドメイン型。null であってはなりません。- 戻り値:
- イントロスペクションの結果。
- 関連事項:
project
インターフェースからコピーされた説明:RelationalConverter
射影をRowDocument
に適用し、射影の戻り値の型R
を返します。Non-projecting
記述子はregular object materialization
にフォールバックします。- 次で指定:
- インターフェース
RelationalConverter
のproject
- パラメーター:
projection
- 射影記述子は null であってはなりません。document
- null であってはなりません。- 戻り値:
- 射影戻り型
R
の新しいインスタンス。
newProjectingConversionContext
protected <R> MappingRelationalConverter.ProjectingConversionContext newProjectingConversionContext(EntityProjection<R, ?> projection) doReadProjection
protected <R> R doReadProjection(MappingRelationalConverter.ConversionContext context, RowDocument document, EntityProjection<R, ?> projection) read
RowDocument
をリクエストされたaggregate type
SE に読み取ります。- 次で指定:
- インターフェース
RelationalConverter
のread
- 型パラメーター:
R
- 集約型。- パラメーター:
type
- ターゲットの集約型。source
- ソースRowDocument
。- 戻り値:
- 変換されたオブジェクト。
read
readAggregate
protected <S> S readAggregate(MappingRelationalConverter.ConversionContext context, RowDocument document, TypeInformation<? extends S> typeHint) document
からオブジェクトを実体化するための変換メソッド。サブクラスによってオーバーライドできます。- パラメーター:
context
- null であってはなりませんdocument
- null であってはなりませんtypeHint
- このRowDocument
をアンマーシャリングするために使用されるTypeInformation
。- 戻り値:
- 変換されたオブジェクトが null になることはありません。
readAggregate
protected <S> S readAggregate(MappingRelationalConverter.ConversionContext context, RowDocumentAccessor documentAccessor, TypeInformation<? extends S> typeHint) document
からオブジェクトを実体化するための変換メソッド。サブクラスによってオーバーライドできます。- パラメーター:
context
- null であってはなりませんdocumentAccessor
- null であってはなりませんtypeHint
- このRowDocument
をアンマーシャリングするために使用されるTypeInformation
。- 戻り値:
- 変換されたオブジェクトが null になることはありません。
readMap
protected MapSE<ObjectSE,ObjectSE> readMap(MappingRelationalConverter.ConversionContext context, MapSE<?, ?> source, TypeInformation<?> targetType) - パラメーター:
context
- null であってはなりませんsource
- null であってはなりませんtargetType
- このRowDocument
をアンマーシャリングするために使用されるMap
SETypeInformation
。- 戻り値:
- 変換された
Map
SE が null になることはありません。
readCollectionOrArray
protected ObjectSE readCollectionOrArray(MappingRelationalConverter.ConversionContext context, CollectionSE<?> source, TypeInformation<?> targetType) 指定されたCollection
SE を指定されたTypeInformation
のコレクションに読み取ります。サブクラスによってオーバーライドできます。- パラメーター:
context
- null であってはなりませんsource
- null であってはなりませんtargetType
- このRowDocument
をアンマーシャリングするために使用されるMap
SETypeInformation
。- 戻り値:
- 変換された
Collection
SE または配列が null になることはありません。
createInstance
public <T> T createInstance(PersistentEntity<T, RelationalPersistentProperty> entity, FunctionSE<Parameter<?, RelationalPersistentProperty>, ObjectSE> parameterValueProvider) インターフェースからコピーされた説明:RelationalConverter
ParameterValueProvider
を指定してPersistentEntity
の新しいインスタンスを作成し、コンストラクタープロパティを取得します。- 次で指定:
- インターフェース
RelationalConverter
のcreateInstance
- 型パラメーター:
T
- 作成するエンティティの型。- パラメーター:
entity
- 作成するエンティティの種類。null
であってはなりません。parameterValueProvider
-Parameter
を指定して、コンストラクターに渡す値を提供する関数。null
であってはなりません。- 戻り値:
- インスタンス化されたエンティティ。
null
でないことが保証されています。
newValueProvider
protected MappingRelationalConverter.RelationalPropertyValueProvider newValueProvider(RowDocumentAccessor documentAccessor, SpELExpressionEvaluator evaluator, MappingRelationalConverter.ConversionContext context) readValue
インターフェースからコピーされた説明:RelationalConverter
関係値を目的のdestination type
に読み取ります。- 次で指定:
- インターフェース
RelationalConverter
のreadValue
- パラメーター:
value
- 永続ストアにアクセスするドライバーによって返される値。null
の場合があります。type
- 値が変換されるTypeInformation
。null
であってはなりません。- 戻り値:
- 変換された値。
null
の場合があります。
getPotentiallyConvertedSimpleRead
指定された単純なオブジェクトにカスタム変換があるかどうかを確認します。指定された値がある場合は変換し、Enum
SE 処理を適用するか、値をそのまま返します。- パラメーター:
value
- 変換されること。null
かもしれません。type
- 値が変換されるTypeInformation
。null
であってはなりません。- 戻り値:
- 変換が適用される場合は変換後の値、または元の値。
null
を返す場合があります。
writeValue
インターフェースからコピーされた説明:RelationalConverter
プロパティ値を、ネイティブに格納できるリレーショナル型に書き込みます。- 次で指定:
- インターフェース
RelationalConverter
のwriteValue
- パラメーター:
value
- オブジェクトモデルで使用される値。null
の場合があります。type
- 値が変換されるTypeInformation
。null
であってはなりません。- 戻り値:
- 変換された値。
null
の場合があります。