Package io.ebeaninternal.server.type
Interface TypeManager
-
- All Known Implementing Classes:
DefaultTypeManager
public interface TypeManager
Convert an Object to the required type.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
add(ScalarType<?> scalarType)
Register a ScalarType with the system.void
addEnumType(ScalarType<?> type, Class<? extends Enum> myEnumClass)
Register a ScalarType for an Enum with can have multiple classes.ScalarType<?>
createEnumScalarType(Class<? extends Enum<?>> enumType, javax.persistence.EnumType enumerated)
Create a ScalarType for an Enum using a mapping (rather than JPA Ordinal or String which has limitations).ScalarType<?>
getArrayScalarType(Class<?> type, io.ebean.annotation.DbArray dbArray, Type genericType, boolean nullable)
Return the ScalarType used to handle DB ARRAY.ScalarType<?>
getDbMapScalarType()
Return the ScalarType used to handle HSTORE (Map). ScalarType<?>
getJsonScalarType(DeployBeanProperty prop, int dbType, int dbLength)
Return the ScalarType used to handle JSON content.ScalarType<?>
getScalarType(int jdbcType)
Return the ScalarType for a given jdbc type.ScalarType<?>
getScalarType(Class<?> type)
Return the ScalarType for a given logical type.ScalarType<?>
getScalarType(Class<?> type, int jdbcType)
For java.util.Date and java.util.Calendar additionally pass the jdbc type that you would like the ScalarType to map to.ScalarType<?>
getScalarType(String cast)
Return the scalar type for the given logical type.
-
-
-
Method Detail
-
add
void add(ScalarType<?> scalarType)
Register a ScalarType with the system.
-
addEnumType
void addEnumType(ScalarType<?> type, Class<? extends Enum> myEnumClass)
Register a ScalarType for an Enum with can have multiple classes.
-
getScalarType
ScalarType<?> getScalarType(String cast)
Return the scalar type for the given logical type.
-
getScalarType
ScalarType<?> getScalarType(int jdbcType)
Return the ScalarType for a given jdbc type.- Parameters:
jdbcType
- as per java.sql.Types
-
getScalarType
ScalarType<?> getScalarType(Class<?> type)
Return the ScalarType for a given logical type.
-
getScalarType
ScalarType<?> getScalarType(Class<?> type, int jdbcType)
For java.util.Date and java.util.Calendar additionally pass the jdbc type that you would like the ScalarType to map to. This is because these types can map to different java.sql.Types depending on the property.
-
createEnumScalarType
ScalarType<?> createEnumScalarType(Class<? extends Enum<?>> enumType, javax.persistence.EnumType enumerated)
Create a ScalarType for an Enum using a mapping (rather than JPA Ordinal or String which has limitations).
-
getJsonScalarType
ScalarType<?> getJsonScalarType(DeployBeanProperty prop, int dbType, int dbLength)
Return the ScalarType used to handle JSON content.Note that type expected to be JsonNode or Map.
-
getArrayScalarType
ScalarType<?> getArrayScalarType(Class<?> type, io.ebean.annotation.DbArray dbArray, Type genericType, boolean nullable)
Return the ScalarType used to handle DB ARRAY.
-
getDbMapScalarType
ScalarType<?> getDbMapScalarType()
Return the ScalarType used to handle HSTORE (Map).
-
-