Package org.alfresco.ibatis
Class SerializableTypeHandler
- java.lang.Object
-
- org.alfresco.ibatis.SerializableTypeHandler
-
- All Implemented Interfaces:
org.apache.ibatis.type.TypeHandler
public class SerializableTypeHandler extends java.lang.Object implements org.apache.ibatis.type.TypeHandlerMyBatis 3.x TypeHandler for java.io.Serializable to BLOB types.- Since:
- 4.0
- Author:
- Derek Hulley, janv
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSerializableTypeHandler.DeserializationExceptionMarker exception to allow deserialization issues to be dealt with by calling code.static classSerializableTypeHandler.SerializationExceptionMarker exception to allow serialization issues to be dealt with by calling code.
-
Field Summary
Fields Modifier and Type Field Description static intDEFAULT_SERIALIZABLE_TYPE
-
Constructor Summary
Constructors Constructor Description SerializableTypeHandler()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.ObjectgetResult(java.sql.CallableStatement cs, int columnIndex)java.lang.ObjectgetResult(java.sql.ResultSet rs, int columnIndex)java.lang.ObjectgetResult(java.sql.ResultSet rs, java.lang.String columnName)static intgetSerializableType()voidsetParameter(java.sql.PreparedStatement ps, int i, java.lang.Object parameter, org.apache.ibatis.type.JdbcType jdbcType)static voidsetSerializableType(int serializableType)java.lang.ObjectvalueOf(java.lang.String s)
-
-
-
Field Detail
-
DEFAULT_SERIALIZABLE_TYPE
public static final int DEFAULT_SERIALIZABLE_TYPE
- See Also:
- Constant Field Values
-
-
Method Detail
-
setSerializableType
public static void setSerializableType(int serializableType)
- See Also:
Types
-
getSerializableType
public static int getSerializableType()
- Returns:
- Returns the SQL type to use for serializable columns
-
getResult
public java.lang.Object getResult(java.sql.ResultSet rs, java.lang.String columnName) throws java.sql.SQLException- Specified by:
getResultin interfaceorg.apache.ibatis.type.TypeHandler- Throws:
SerializableTypeHandler.DeserializationException- if the object could not be deserializedjava.sql.SQLException
-
getResult
public java.lang.Object getResult(java.sql.ResultSet rs, int columnIndex) throws java.sql.SQLException- Specified by:
getResultin interfaceorg.apache.ibatis.type.TypeHandler- Throws:
java.sql.SQLException
-
setParameter
public void setParameter(java.sql.PreparedStatement ps, int i, java.lang.Object parameter, org.apache.ibatis.type.JdbcType jdbcType) throws java.sql.SQLException- Specified by:
setParameterin interfaceorg.apache.ibatis.type.TypeHandler- Throws:
java.sql.SQLException
-
getResult
public java.lang.Object getResult(java.sql.CallableStatement cs, int columnIndex) throws java.sql.SQLException- Specified by:
getResultin interfaceorg.apache.ibatis.type.TypeHandler- Throws:
java.sql.SQLException
-
valueOf
public java.lang.Object valueOf(java.lang.String s)
- Returns:
- Returns the value given
-
-