Class AbstractLargeBinaryColumnMapping
- java.lang.Object
-
- org.datanucleus.store.rdbms.mapping.column.AbstractColumnMapping
-
- org.datanucleus.store.rdbms.mapping.column.AbstractLargeBinaryColumnMapping
-
- All Implemented Interfaces:
ColumnMapping
- Direct Known Subclasses:
BinaryColumnMapping,BlobColumnMapping,LongVarBinaryColumnMapping,VarBinaryColumnMapping
public abstract class AbstractLargeBinaryColumnMapping extends AbstractColumnMapping
Mapping of a large binary (e.g BLOB, LONGVARBINARY) column. A large binary column can be treated in two ways in terms of storage and retrieval.- Serialise the field into the large binary using ObjectOutputStream, and deserialise it back using ObjectInputStream - i.e Java serialisation
- Store the field using a byte[] stream, and retrieve it in the same way.
-
-
Field Summary
-
Fields inherited from class org.datanucleus.store.rdbms.mapping.column.AbstractColumnMapping
column, mapping, storeMgr
-
-
Constructor Summary
Constructors Constructor Description AbstractLargeBinaryColumnMapping(JavaTypeMapping mapping, RDBMSStoreManager storeMgr, Column col)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ObjectgetObject(ResultSet rs, int param)Method to retrieve the object from the large binary column.protected ObjectgetObjectForBytes(byte[] bytes, int param)StringgetString(ResultSet resultSet, int exprIndex)Accessor for String value when serialised.protected voidinitialize()Initialisation method, initialising the type info.voidsetObject(PreparedStatement ps, int param, Object value)Method to store a field into a "large varbinary" column.voidsetString(PreparedStatement ps, int exprIndex, String value)Cater for serialisation of Strings.-
Methods inherited from class org.datanucleus.store.rdbms.mapping.column.AbstractColumnMapping
equals, failureMessage, failureMessage, failureMessage, getBoolean, getByte, getChar, getColumn, getDatastoreAdapter, getDouble, getFloat, getInsertionInputParameter, getInt, getJavaTypeMapping, getJDBCType, getLong, getShort, getTypeInfo, getUpdateInputParameter, hashCode, includeInFetchStatement, initTypeInfo, insertValuesOnInsert, isBitBased, isBooleanBased, isDecimalBased, isIntegerBased, isNullable, isStringBased, setBoolean, setByte, setChar, setDouble, setFloat, setInt, setLong, setShort, useDefaultWhenNull
-
-
-
-
Constructor Detail
-
AbstractLargeBinaryColumnMapping
public AbstractLargeBinaryColumnMapping(JavaTypeMapping mapping, RDBMSStoreManager storeMgr, Column col)
Constructor.- Parameters:
mapping- Java type mappingstoreMgr- Store Managercol- Column
-
-
Method Detail
-
initialize
protected void initialize()
Initialisation method, initialising the type info.
-
setObject
public void setObject(PreparedStatement ps, int param, Object value)
Method to store a field into a "large varbinary" column.- Specified by:
setObjectin interfaceColumnMapping- Overrides:
setObjectin classAbstractColumnMapping- Parameters:
ps- The PreparedStatementparam- Parameter position in the statementvalue- The value to store
-
getObjectForBytes
protected Object getObjectForBytes(byte[] bytes, int param)
-
getObject
public Object getObject(ResultSet rs, int param)
Method to retrieve the object from the large binary column.- Specified by:
getObjectin interfaceColumnMapping- Overrides:
getObjectin classAbstractColumnMapping- Parameters:
rs- The ResultSetparam- The parameter position- Returns:
- The object
-
setString
public void setString(PreparedStatement ps, int exprIndex, String value)
Cater for serialisation of Strings.- Specified by:
setStringin interfaceColumnMapping- Overrides:
setStringin classAbstractColumnMapping- Parameters:
ps- PreparedStatementexprIndex- param indexesvalue- The value of the String
-
getString
public String getString(ResultSet resultSet, int exprIndex)
Accessor for String value when serialised.- Specified by:
getStringin interfaceColumnMapping- Overrides:
getStringin classAbstractColumnMapping- Parameters:
resultSet- ResultSetexprIndex- param indexes- Returns:
- The String value
-
-