Package io.ebeaninternal.server.type
Class ScalarTypeEnumStandard.StringEnum
- java.lang.Object
-
- io.ebeaninternal.server.type.ScalarTypeBase
-
- io.ebeaninternal.server.type.ScalarTypeEnumStandard.EnumBase
-
- io.ebeaninternal.server.type.ScalarTypeEnumStandard.StringEnum
-
- All Implemented Interfaces:
StringFormatter
,StringParser
,ScalarDataReader
,ScalarType
,ScalarTypeEnum
- Enclosing class:
- ScalarTypeEnumStandard
public static class ScalarTypeEnumStandard.StringEnum extends ScalarTypeEnumStandard.EnumBase implements ScalarTypeEnum
-
-
Constructor Summary
Constructors Constructor Description StringEnum(Class enumType)
Create a ScalarTypeEnum.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
bind(DataBind b, Object value)
Convert (if necessary) and bind the value to the preparedStatement.Set<String>
getDbCheckConstraintValues()
Return the IN values for DB constraint construction.int
getLength()
Just return 0.boolean
isCompatible(javax.persistence.EnumType enumType)
Return true if the scalar type is compatible with the specified enum type.Object
read(DataReader dataReader)
Read the value from the resultSet and convert if necessary to the logical bean property value.Object
toBeanType(Object dbValue)
Convert the value as necessary to the logical Bean type.Object
toJdbcType(Object beanValue)
Convert the Boolean value to the db value.-
Methods inherited from class io.ebeaninternal.server.type.ScalarTypeEnumStandard.EnumBase
convertFromMillis, format, formatValue, getDocType, isDateTimeCapable, jsonRead, jsonWrite, parse, readData, writeData
-
Methods inherited from class io.ebeaninternal.server.type.ScalarTypeBase
asVersion, getJdbcType, getType, isBinaryType, isDirty, isJdbcNative, isMutable, loadIgnore
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.ebeaninternal.server.type.ScalarType
asVersion, convertFromMillis, format, formatValue, getDocType, getJdbcType, getType, isBinaryType, isDateTimeCapable, isDirty, isJdbcNative, isMutable, jsonRead, jsonWrite, loadIgnore, parse, readData, writeData
-
Methods inherited from interface io.ebeaninternal.server.type.ScalarTypeEnum
isOverrideBy
-
-
-
-
Constructor Detail
-
StringEnum
public StringEnum(Class enumType)
Create a ScalarTypeEnum.
-
-
Method Detail
-
isCompatible
public boolean isCompatible(javax.persistence.EnumType enumType)
Description copied from interface:ScalarTypeEnum
Return true if the scalar type is compatible with the specified enum type.- Specified by:
isCompatible
in interfaceScalarTypeEnum
-
getDbCheckConstraintValues
public Set<String> getDbCheckConstraintValues()
Return the IN values for DB constraint construction.- Specified by:
getDbCheckConstraintValues
in interfaceScalarTypeEnum
-
getLength
public int getLength()
Description copied from class:ScalarTypeBase
Just return 0.- Specified by:
getLength
in interfaceScalarType
- Overrides:
getLength
in classScalarTypeBase
-
bind
public void bind(DataBind b, Object value) throws SQLException
Description copied from interface:ScalarType
Convert (if necessary) and bind the value to the preparedStatement.value may need to be converted from the logical bean property type to the JDBC type.
- Specified by:
bind
in interfaceScalarType
- Throws:
SQLException
-
read
public Object read(DataReader dataReader) throws SQLException
Description copied from interface:ScalarType
Read the value from the resultSet and convert if necessary to the logical bean property value.- Specified by:
read
in interfaceScalarDataReader
- Specified by:
read
in interfaceScalarType
- Throws:
SQLException
-
toJdbcType
public Object toJdbcType(Object beanValue)
Convert the Boolean value to the db value.- Specified by:
toJdbcType
in interfaceScalarType
-
toBeanType
public Object toBeanType(Object dbValue)
Description copied from interface:ScalarType
Convert the value as necessary to the logical Bean type.The type as per the bean property.
This is used to automatically convert id values (typically from a string to a int, long or UUID).
- Specified by:
toBeanType
in interfaceScalarType
-
-