org.datanucleus.store.mapped.mapping
Class EmbeddedPCMapping

java.lang.Object
  extended by org.datanucleus.store.mapped.mapping.JavaTypeMapping
      extended by org.datanucleus.store.mapped.mapping.SingleFieldMapping
          extended by org.datanucleus.store.mapped.mapping.EmbeddedMapping
              extended by org.datanucleus.store.mapped.mapping.EmbeddedPCMapping
All Implemented Interfaces:
MappingCallbacks

public class EmbeddedPCMapping
extends EmbeddedMapping
implements MappingCallbacks

Mapping for a PC object embedded within another PC object (1-1 relation). Provides mapping for a single Java type (the PC type) to multiple datastore columns. Allows for nested embedded fields. Implements MappingCallbacks since if we are embedding a MappingCallbacks field (e.g a BLOB on Oracle) then we need in turn to call the underlying MappingCallbacks methods.


Field Summary
 
Fields inherited from class org.datanucleus.store.mapped.mapping.EmbeddedMapping
clr, embCmd, emd, javaTypeMappings, objectType, typeName
 
Fields inherited from class org.datanucleus.store.mapped.mapping.JavaTypeMapping
datastoreContainer, datastoreMappings, LOCALISER, mmd, referenceMapping, roleForMember, storeMgr, type
 
Constructor Summary
EmbeddedPCMapping()
           
 
Method Summary
 void initialize(AbstractMemberMetaData mmd, DatastoreContainerObject container, ClassLoaderResolver clr)
          Initialize this JavaTypeMapping with the given DatastoreAdapter for the given metadata.
 void insertPostProcessing(StateManager sm)
          Hook so that we can handle any post-processing on the insert of a particular field.
 void postFetch(StateManager sm)
          MappingCallback called when the owning object is being fetched.
 void postInsert(StateManager sm)
          MappingCallback called when the owning object has just being inserted.
 void postUpdate(StateManager sm)
          MappingCallback called when the owning object has just being udpated.
 void preDelete(StateManager sm)
          MappingCallback called when the owning object is about to be deleted.
 
Methods inherited from class org.datanucleus.store.mapped.mapping.EmbeddedMapping
addJavaTypeMapping, getJavaType, getJavaTypeMapping, getJavaTypeMapping, getNumberOfJavaTypeMappings, getObject, getObject, getSampleValue, initialize, newLiteral, newScalarExpression, prepareDatastoreMapping, setObject, setObject
 
Methods inherited from class org.datanucleus.store.mapped.mapping.SingleFieldMapping
equals, getBoolean, getByte, getChar, getDefaultLength, getDouble, getFloat, getInt, getJavaTypeForDatastoreMapping, getLong, getShort, getString, getValidValues, setBoolean, setByte, setChar, setDouble, setFloat, setInt, setLong, setShort, setString
 
Methods inherited from class org.datanucleus.store.mapped.mapping.JavaTypeMapping
addDatastoreMapping, failureMessage, getColumnMetaDataForMember, getDatastoreContainer, getDatastoreMapping, getDatastoreMappings, getMemberMetaData, getNumberOfDatastoreMappings, getReferenceMapping, getRoleForMember, getType, getValueForDatastoreMapping, hashCode, hasSimpleDatastoreRepresentation, includeInFetchStatement, includeInInsertStatement, includeInUpdateStatement, initialize, isNullable, isSerialised, setDatastoreContainer, setDefault, setMemberMetaData, setReferenceMapping, setRoleForMember
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EmbeddedPCMapping

public EmbeddedPCMapping()
Method Detail

initialize

public void initialize(AbstractMemberMetaData mmd,
                       DatastoreContainerObject container,
                       ClassLoaderResolver clr)
Initialize this JavaTypeMapping with the given DatastoreAdapter for the given metadata.

Overrides:
initialize in class EmbeddedMapping
Parameters:
mmd - FieldMetaData for the field to be mapped (if any)
container - The datastore container storing this mapping (if any)
clr - the ClassLoaderResolver

insertPostProcessing

public void insertPostProcessing(StateManager sm)
Description copied from interface: MappingCallbacks
Hook so that we can handle any post-processing on the insert of a particular field. For example with Oracle we need to insert "EMPTY_CLOB" and then immediately after do a SELECT of it and update the contents of the CLOB/BLOB.

Specified by:
insertPostProcessing in interface MappingCallbacks
Parameters:
sm - StateManager

postFetch

public void postFetch(StateManager sm)
MappingCallback called when the owning object is being fetched.

Specified by:
postFetch in interface MappingCallbacks
Parameters:
sm - StateManager of the owning object

postInsert

public void postInsert(StateManager sm)
MappingCallback called when the owning object has just being inserted.

Specified by:
postInsert in interface MappingCallbacks
Parameters:
sm - StateManager of the owning object

postUpdate

public void postUpdate(StateManager sm)
MappingCallback called when the owning object has just being udpated.

Specified by:
postUpdate in interface MappingCallbacks
Parameters:
sm - StateManager of the owning object

preDelete

public void preDelete(StateManager sm)
MappingCallback called when the owning object is about to be deleted.

Specified by:
preDelete in interface MappingCallbacks
Parameters:
sm - StateManager of the owning object


Copyright © 2010. All Rights Reserved.