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 org.datanucleus.store.rdbms.mapping.column.AbstractColumnMapping
column, mapping, storeMgr
-
Constructor Summary
ConstructorsConstructorDescriptionBlobColumnMapping
(JavaTypeMapping mapping, RDBMSStoreManager storeMgr, Column col) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionint
Method 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.void
setString
(PreparedStatement ps, int param, String value) Cater for serialisation of Strings.Methods inherited from class org.datanucleus.store.rdbms.mapping.column.AbstractLargeBinaryColumnMapping
getObjectForBytes, initialize, setObject
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, 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:AbstractColumnMapping
Method to return the java.sql.Types type that this relates to.- Specified by:
getJDBCType
in classAbstractColumnMapping
- Returns:
- The JDBC "type"
-
getObject
Description copied from class:AbstractLargeBinaryColumnMapping
Method to retrieve the object from the large binary column.- Specified by:
getObject
in interfaceColumnMapping
- Overrides:
getObject
in classAbstractLargeBinaryColumnMapping
- Parameters:
rs
- The ResultSetparam
- The parameter position- Returns:
- The object
-
setString
Description copied from class:AbstractLargeBinaryColumnMapping
Cater for serialisation of Strings.- Specified by:
setString
in interfaceColumnMapping
- Overrides:
setString
in classAbstractLargeBinaryColumnMapping
- Parameters:
ps
- PreparedStatementparam
- param indexesvalue
- The value of the String
-
getString
Description copied from class:AbstractLargeBinaryColumnMapping
Accessor for String value when serialised.- Specified by:
getString
in interfaceColumnMapping
- Overrides:
getString
in classAbstractLargeBinaryColumnMapping
- Parameters:
rs
- ResultSetparam
- param indexes- Returns:
- The String value
-