B
- The value object type.S
- The scalar object type that is used to persist the value object.public interface ScalarTypeConverter<B,S>
In general AttributeConverter should be used in preference to this ScalarTypeConverter as it is JPA standard and offers the same functionality.
For Ebean we will look to deprecate this interface in preference to AttributeConverter.
Used to convert between a value object and a known scalar type. The value object is the logical type used in your application and the scalar type is the value used to persist than to the DB.
The Value object should be immutable and scalar (aka not compound) and converts to and from a known scalar type which Ebean will use to persist the value.
Modifier and Type | Method and Description |
---|---|
B |
getNullValue()
Return the value to represent null.
|
S |
unwrapValue(B beanType)
Convert the value object into a scalar value that Ebean knows how to
persist.
|
B |
wrapValue(S scalarType)
Convert the scalar type value into the value object.
|
B getNullValue()
B wrapValue(S scalarType)
This typically occurs when Ebean reads the value from a resultSet or other data source.
scalarType
- the value from the data sourceS unwrapValue(B beanType)
This typically occurs when Ebean is persisting the value object to the data store.
beanType
- the value objectCopyright © 2018. All rights reserved.