Class SerialisedReferenceMapping
java.lang.Object
org.datanucleus.store.rdbms.mapping.java.JavaTypeMapping
org.datanucleus.store.rdbms.mapping.java.SingleFieldMapping
org.datanucleus.store.rdbms.mapping.java.SerialisedMapping
org.datanucleus.store.rdbms.mapping.java.SerialisedReferenceMapping
Mapping for a serialised reference (Interface/Object) field.
Extends SerialisedMapping since that provides the basic serialisation mechanism,
adding on the addition of StateManagers to the serialised object whenever it is required
(since the object is a persistable).
-
Field Summary
Fields inherited from class org.datanucleus.store.rdbms.mapping.java.SingleFieldMapping
EXTENSION_CHECK_CONSTRAINT_VALUES
Fields inherited from class org.datanucleus.store.rdbms.mapping.java.JavaTypeMapping
absFieldNumber, columnMappings, mmd, referenceMapping, roleForMember, storeMgr, table, type
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionMethod to extract the value of the persistable from a ResultSet.getObject
(org.datanucleus.ExecutionContext ec, ResultSet resultSet, int[] exprIndex, org.datanucleus.state.DNStateManager ownerSM, int fieldNumber) Method to extract the value of the persistable from a ResultSet.void
setObject
(org.datanucleus.ExecutionContext ec, PreparedStatement ps, int[] exprIndex, Object value) Method to populate parameter positions in a PreparedStatement with this objectvoid
setObject
(org.datanucleus.ExecutionContext ec, PreparedStatement ps, int[] exprIndex, Object value, org.datanucleus.state.DNStateManager ownerSM, int fieldNumber) Method to populate parameter positions in a PreparedStatement with this objectMethods inherited from class org.datanucleus.store.rdbms.mapping.java.SerialisedMapping
getJavaType, getJavaTypeForColumnMapping
Methods inherited from class org.datanucleus.store.rdbms.mapping.java.SingleFieldMapping
getBoolean, getByte, getChar, getDefaultLength, getDouble, getFloat, getInt, getLong, getShort, getString, getValidValues, initialize, prepareColumnMapping, setBoolean, setByte, setChar, setDouble, setFloat, setInt, setLong, setShort, setString
Methods inherited from class org.datanucleus.store.rdbms.mapping.java.JavaTypeMapping
addColumnMapping, equals, failureMessage, getAbsoluteFieldNumber, getColumnMapping, getColumnMappings, getColumnMetaDataForMember, getMemberMetaData, getNumberOfColumnMappings, getReferenceMapping, getRoleForMember, getStoreManager, getTable, getType, getValueForColumnMapping, hashCode, hasSimpleDatastoreRepresentation, includeInFetchStatement, includeInInsertStatement, includeInUpdateStatement, initialize, isNullable, isSerialised, performSetPostProcessing, representableAsStringLiteralInStatement, requiresSetPostProcessing, setAbsFieldNumber, setMemberMetaData, setReferenceMapping, setRoleForMember, setTable
-
Constructor Details
-
SerialisedReferenceMapping
public SerialisedReferenceMapping()
-
-
Method Details
-
setObject
public void setObject(org.datanucleus.ExecutionContext ec, PreparedStatement ps, int[] exprIndex, Object value) Method to populate parameter positions in a PreparedStatement with this object- Overrides:
setObject
in classSingleFieldMapping
- Parameters:
ec
- execution contextps
- The Prepared StatementexprIndex
- The parameter positions to populatevalue
- The value of the PC to use in populating the parameter positions
-
setObject
public void setObject(org.datanucleus.ExecutionContext ec, PreparedStatement ps, int[] exprIndex, Object value, org.datanucleus.state.DNStateManager ownerSM, int fieldNumber) Method to populate parameter positions in a PreparedStatement with this object- Overrides:
setObject
in classJavaTypeMapping
- Parameters:
ec
- execution contextps
- The Prepared StatementexprIndex
- The parameter positions to populatevalue
- The value of the PC to use in populating the parameter positionsownerSM
- StateManager for the owning objectfieldNumber
- field number of this object in the owning object
-
getObject
Method to extract the value of the persistable from a ResultSet.- Overrides:
getObject
in classSingleFieldMapping
- Parameters:
ec
- execution contextresultSet
- The ResultSetexprIndex
- The parameter positions in the result set to use.- Returns:
- The (deserialised) persistable object
-
getObject
public Object getObject(org.datanucleus.ExecutionContext ec, ResultSet resultSet, int[] exprIndex, org.datanucleus.state.DNStateManager ownerSM, int fieldNumber) Method to extract the value of the persistable from a ResultSet.- Overrides:
getObject
in classJavaTypeMapping
- Parameters:
ec
- execution contextresultSet
- The ResultSetexprIndex
- The parameter positions in the result set to use.ownerSM
- StateManager for the owning objectfieldNumber
- Absolute number of field in owner object- Returns:
- The (deserialised) persistable object
-