X
- The type of the attributeY
- The type of the native value stored in the database@Introspected
public interface AttributeConverter<X,Y>
AttributeConverter
without being specific to
any database type.Modifier and Type | Method and Description |
---|---|
X |
convertToEntityAttribute(Y value,
RuntimePersistentProperty<X> property)
Converts the data stored in the database to a value that can
be written to the entity attribute.
|
Y |
convertToNativeValue(X attribute,
RuntimePersistentProperty<X> property)
Converts the value stored in the entity attribute into a native value that can
be persisted to the target database.
|
@NonNull Y convertToNativeValue(@NonNull X attribute, @NonNull RuntimePersistentProperty<X> property)
attribute
- the entity attribute value to be convertedproperty
- The property that the attribute relates to@NonNull X convertToEntityAttribute(@NonNull Y value, @NonNull RuntimePersistentProperty<X> property)
value
- the data read from the databaseproperty
- The property that represents the attribute