Class BlobColumnMapping
java.lang.Object
org.datanucleus.store.rdbms.mapping.column.AbstractColumnMapping
org.datanucleus.store.rdbms.mapping.column.AbstractLargeBinaryColumnMapping
org.datanucleus.store.rdbms.mapping.column.BlobColumnMapping
- All Implemented Interfaces:
ColumnMapping
Mapping of a BLOB column.
A BLOB column can be treated in two ways in terms of storage and retrieval.
- Serialise the field into the BLOB using ObjectOutputStream, and deserialise it back using ObjectInputStream
- Store the field using a byte[] stream, and retrieve it in the same way.
-
Field Summary
Fields inherited from class AbstractColumnMapping
column, mapping, storeMgr -
Constructor Summary
ConstructorsConstructorDescriptionBlobColumnMapping(JavaTypeMapping mapping, RDBMSStoreManager storeMgr, Column col) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionintMethod to return the java.sql.Types type that this relates to.Method to retrieve the object from the large binary column.Accessor for String value when serialised.voidsetString(PreparedStatement ps, int param, String value) Cater for serialisation of Strings.Methods inherited from class AbstractLargeBinaryColumnMapping
getObjectForBytes, initialize, setObjectMethods inherited from class AbstractColumnMapping
equals, failureMessage, failureMessage, failureMessage, getBoolean, getByte, getChar, getColumn, getDatastoreAdapter, getDouble, getFloat, getInsertionInputParameter, getInt, getJavaTypeMapping, getLong, getShort, getTypeInfo, getUpdateInputParameter, hashCode, includeInFetchStatement, initTypeInfo, insertValuesOnInsert, isBitBased, isBooleanBased, isDecimalBased, isIntegerBased, isNullable, isStringBased, setBoolean, setByte, setChar, setDouble, setFloat, setInt, setLong, setShort, useDefaultWhenNull
-
Constructor Details
-
BlobColumnMapping
Constructor.- Parameters:
mapping- Java type mappingstoreMgr- Store Managercol- Column
-
-
Method Details
-
getJDBCType
public int getJDBCType()Description copied from class:AbstractColumnMappingMethod to return the java.sql.Types type that this relates to.- Specified by:
getJDBCTypein classAbstractColumnMapping- Returns:
- The JDBC "type"
-
getObject
Description copied from class:AbstractLargeBinaryColumnMappingMethod to retrieve the object from the large binary column.- Specified by:
getObjectin interfaceColumnMapping- Overrides:
getObjectin classAbstractLargeBinaryColumnMapping- Parameters:
rs- The ResultSetparam- The parameter position- Returns:
- The object
-
setString
Description copied from class:AbstractLargeBinaryColumnMappingCater for serialisation of Strings.- Specified by:
setStringin interfaceColumnMapping- Overrides:
setStringin classAbstractLargeBinaryColumnMapping- Parameters:
ps- PreparedStatementparam- param indexesvalue- The value of the String
-
getString
Description copied from class:AbstractLargeBinaryColumnMappingAccessor for String value when serialised.- Specified by:
getStringin interfaceColumnMapping- Overrides:
getStringin classAbstractLargeBinaryColumnMapping- Parameters:
rs- ResultSetparam- param indexes- Returns:
- The String value
-