| java.lang.Object org.jpox.store.mapping.JavaTypeMapping org.jpox.store.mapping.SingleFieldMapping org.jpox.store.mapping.OIDMapping org.jpox.store.mapping.PersistenceCapableMapping
All known Subclasses: org.jpox.store.mapping.ObjectIdClassMapping,
PersistenceCapableMapping | public class PersistenceCapableMapping extends OIDMapping implements MappingCallbacks(Code) | | Maps a java field to a PersistenceCapable class.
For PersistenceCapable classes using datastore identity most of the necessary behaviour
is coded in the OIDMapping super class.
TODO Split this from OIDMapping since a PCMapping may represent an application
identity object instead of a datastore identity object
version: $Revision: 1.154 $ |
Method Summary | |
public void | addJavaTypeMapping(JavaTypeMapping mapping) | public DatastoreMapping | getDataStoreMapping(int index) Accessor for a datastore mapping.
This method works through the java type mappings, and for each mapping through its datastore mappings
incrementing the index with each datastore mapping.
Parameters: index - The position of the mapping. | public JavaTypeMapping[] | getJavaTypeMapping() | public int | getNumberOfDatastoreFields() Accessor for the number of datastore fields. | public Object | getObject(ObjectManager om, Object rs, int[] param) Returns a instance of a PersistenceCapable class. | public void | initialize(DatastoreAdapter dba, AbstractMemberMetaData fmd, DatastoreContainerObject container, ClassLoaderResolver clr) Initialize this JavaTypeMapping with the given DatastoreAdapter for
the given FieldMetaData. | public ScalarExpression | newLiteral(QueryExpression qs, Object value) | public ScalarExpression | newScalarExpression(QueryExpression qs, LogicSetExpression te) | public void | postFetch(StateManager sm) Method executed just after a fetch of the owning object, allowing any necessary action
to this field and the object stored in it. | public void | postInsert(StateManager sm) Method executed just after the insert of the owning object, allowing any necessary action
to this field and the object stored in it. | public void | postUpdate(StateManager sm) Method executed just afer any update of the owning object, allowing any necessary action
to this field and the object stored in it. | public void | preDelete(StateManager sm) Method executed just before the owning object is deleted, allowing tidying up of any
relation information. | protected void | prepareDatastoreMapping() Method to prepare the PC mapping and add its associated datastore mappings. | protected void | prepareDatastoreMapping(ClassLoaderResolver clr) Method to prepare the PC mapping and add its associated datastore mappings. | public void | setObject(ObjectManager om, Object ps, int[] param, Object value) Method to set an object in the datastore. | public void | setObject(ObjectManager om, Object ps, int[] param, Object value, StateManager ownerSM, int ownerFieldNumber) Method to set an object reference (FK) in the datastore. |
javaTypeMappings | protected JavaTypeMapping[] javaTypeMappings(Code) | | Mappings for all fields necessary to represent the id of the PC object.
|
PersistenceCapableMapping | public PersistenceCapableMapping()(Code) | | Create a new empty PersistenceCapableMapping.
The caller must call one of the initialize methods to initialize the instance with the
DatastoreAdapter and its type.
|
addJavaTypeMapping | public void addJavaTypeMapping(JavaTypeMapping mapping)(Code) | | Add a new JavaTypeMapping
Parameters: mapping - the JavaTypeMapping |
getDataStoreMapping | public DatastoreMapping getDataStoreMapping(int index)(Code) | | Accessor for a datastore mapping.
This method works through the java type mappings, and for each mapping through its datastore mappings
incrementing the index with each datastore mapping.
Parameters: index - The position of the mapping. The datastore mapping. |
getJavaTypeMapping | public JavaTypeMapping[] getJavaTypeMapping()(Code) | | Accessor for the Java type mappings
The Java type mappings |
getNumberOfDatastoreFields | public int getNumberOfDatastoreFields()(Code) | | Accessor for the number of datastore fields.
Zero datastore fields implies that the mapping uses a FK in the associated class
to reference back.
Number of datastore fields for this PC mapping. |
getObject | public Object getObject(ObjectManager om, Object rs, int[] param)(Code) | | Returns a instance of a PersistenceCapable class.
Processes a FK field and converts the id stored firstly into an OID/AID
and then into the object that the FK id relates to.
Parameters: om - The Object Manager Parameters: rs - The ResultSet Parameters: param - Array of parameter ids in the ResultSet to retrieve The Persistence Capable object |
initialize | public void initialize(DatastoreAdapter dba, AbstractMemberMetaData fmd, DatastoreContainerObject container, ClassLoaderResolver clr)(Code) | | Initialize this JavaTypeMapping with the given DatastoreAdapter for
the given FieldMetaData.
Parameters: dba - The Datastore Adapter that this Mapping should use. Parameters: fmd - FieldMetaData for the field to be mapped (if any) Parameters: container - The datastore container storing this mapping (if any) Parameters: clr - the ClassLoaderResolver |
postFetch | public void postFetch(StateManager sm)(Code) | | Method executed just after a fetch of the owning object, allowing any necessary action
to this field and the object stored in it.
Parameters: sm - StateManager for the owner. |
postInsert | public void postInsert(StateManager sm)(Code) | | Method executed just after the insert of the owning object, allowing any necessary action
to this field and the object stored in it.
Parameters: sm - StateManager for the owner |
postUpdate | public void postUpdate(StateManager sm)(Code) | | Method executed just afer any update of the owning object, allowing any necessary action
to this field and the object stored in it.
Parameters: sm - StateManager for the owner |
preDelete | public void preDelete(StateManager sm)(Code) | | Method executed just before the owning object is deleted, allowing tidying up of any
relation information.
Parameters: sm - StateManager for the owner |
prepareDatastoreMapping | protected void prepareDatastoreMapping()(Code) | | Method to prepare the PC mapping and add its associated datastore mappings.
|
prepareDatastoreMapping | protected void prepareDatastoreMapping(ClassLoaderResolver clr)(Code) | | Method to prepare the PC mapping and add its associated datastore mappings.
Parameters: clr - The ClassLoaderResolver |
setObject | public void setObject(ObjectManager om, Object ps, int[] param, Object value)(Code) | | Method to set an object in the datastore.
Parameters: om - The ObjectManager Parameters: ps - The Prepared Statement Parameters: param - The parameter ids in the statement Parameters: value - The value to put in the statement at these ids throws: NotYetFlushedException - |
setObject | public void setObject(ObjectManager om, Object ps, int[] param, Object value, StateManager ownerSM, int ownerFieldNumber)(Code) | | Method to set an object reference (FK) in the datastore.
Parameters: om - The Object Manager Parameters: ps - The Prepared Statement Parameters: param - The parameter ids in the statement Parameters: value - The value to put in the statement at these ids Parameters: ownerSM - StateManager for the owner object Parameters: ownerFieldNumber - Field number of this PC object in the owner throws: NotYetFlushedException - |
Methods inherited from org.jpox.store.mapping.SingleFieldMapping | public boolean equals(Object obj)(Code)(Java Doc) public boolean getBoolean(ObjectManager om, Object resultSet, int[] exprIndex)(Code)(Java Doc) public byte getByte(ObjectManager om, Object resultSet, int[] exprIndex)(Code)(Java Doc) public char getChar(ObjectManager om, Object resultSet, int[] exprIndex)(Code)(Java Doc) public int getDefaultLength(int index)(Code)(Java Doc) public double getDouble(ObjectManager om, Object resultSet, int[] exprIndex)(Code)(Java Doc) public float getFloat(ObjectManager om, Object resultSet, int[] exprIndex)(Code)(Java Doc) public int getInt(ObjectManager om, Object resultSet, int[] exprIndex)(Code)(Java Doc) public String getJavaTypeForDatastoreMapping(int index)(Code)(Java Doc) public long getLong(ObjectManager om, Object resultSet, int[] exprIndex)(Code)(Java Doc) public Object getObject(ObjectManager om, Object resultSet, int[] exprIndex)(Code)(Java Doc) public short getShort(ObjectManager om, Object resultSet, int[] exprIndex)(Code)(Java Doc) public String getString(ObjectManager om, Object resultSet, int[] exprIndex)(Code)(Java Doc) public ScalarExpression[] getValidValues(int index)(Code)(Java Doc) public void initialize(DatastoreAdapter dba, AbstractMemberMetaData fmd, DatastoreContainerObject container, ClassLoaderResolver clr)(Code)(Java Doc) protected void prepareDatastoreMapping()(Code)(Java Doc) public void setBoolean(ObjectManager om, Object preparedStatement, int[] exprIndex, boolean value)(Code)(Java Doc) public void setByte(ObjectManager om, Object preparedStatement, int[] exprIndex, byte value)(Code)(Java Doc) public void setChar(ObjectManager om, Object preparedStatement, int[] exprIndex, char value)(Code)(Java Doc) public void setDouble(ObjectManager om, Object preparedStatement, int[] exprIndex, double value)(Code)(Java Doc) public void setFloat(ObjectManager om, Object preparedStatement, int[] exprIndex, float value)(Code)(Java Doc) public void setInt(ObjectManager om, Object preparedStatement, int[] exprIndex, int value)(Code)(Java Doc) public void setLong(ObjectManager om, Object preparedStatement, int[] exprIndex, long value)(Code)(Java Doc) public void setObject(ObjectManager om, Object preparedStatement, int[] exprIndex, Object value)(Code)(Java Doc) public void setShort(ObjectManager om, Object preparedStatement, int[] exprIndex, short value)(Code)(Java Doc) public void setString(ObjectManager om, Object preparedStatement, int[] exprIndex, String value)(Code)(Java Doc)
|
Methods inherited from org.jpox.store.mapping.JavaTypeMapping | public void addDataStoreMapping(DatastoreMapping datastoreMapping)(Code)(Java Doc) protected String failureMessage(String method)(Code)(Java Doc) public boolean getBoolean(ObjectManager om, Object datastoreResults, int[] exprIndex)(Code)(Java Doc) public byte getByte(ObjectManager om, Object datastoreResults, int[] exprIndex)(Code)(Java Doc) public char getChar(ObjectManager om, Object datastoreResults, int[] exprIndex)(Code)(Java Doc) public DatastoreMapping getDataStoreMapping(int index)(Code)(Java Doc) public DatastoreMapping[] getDataStoreMappings()(Code)(Java Doc) public DatastoreContainerObject getDatastoreContainer()(Code)(Java Doc) public double getDouble(ObjectManager om, Object datastoreResults, int[] exprIndex)(Code)(Java Doc) public AbstractMemberMetaData getFieldMetaData()(Code)(Java Doc) public float getFloat(ObjectManager om, Object datastoreResults, int[] exprIndex)(Code)(Java Doc) public int getInt(ObjectManager om, Object datastoreResults, int[] exprIndex)(Code)(Java Doc) abstract public Class getJavaType()(Code)(Java Doc) public String getJavaTypeForDatastoreMapping(int index)(Code)(Java Doc) public long getLong(ObjectManager om, Object datastoreResults, int[] exprIndex)(Code)(Java Doc) public int getNumberOfDatastoreFields()(Code)(Java Doc) public Object getObject(ObjectManager om, Object datastoreResults, int[] exprIndex, StateManager ownerSM, int ownerFieldNumber)(Code)(Java Doc) public Object getObject(ObjectManager om, Object datastoreResults, int[] exprIndex)(Code)(Java Doc) public JavaTypeMapping getReferenceMapping()(Code)(Java Doc) public int getRoleForField()(Code)(Java Doc) abstract public Object getSampleValue(ClassLoaderResolver clr)(Code)(Java Doc) public short getShort(ObjectManager om, Object datastoreResults, int[] exprIndex)(Code)(Java Doc) public String getString(ObjectManager om, Object datastoreResults, int[] exprIndex)(Code)(Java Doc) public String getType()(Code)(Java Doc) public boolean includeInFetchStatement()(Code)(Java Doc) public boolean includeInInsertStatement()(Code)(Java Doc) public boolean includeInUpdateStatement()(Code)(Java Doc) public void initialize(DatastoreAdapter dba, String type)(Code)(Java Doc) public void initialize(DatastoreAdapter dba, AbstractMemberMetaData fmd, DatastoreContainerObject container, ClassLoaderResolver clr)(Code)(Java Doc) public boolean isNullable()(Code)(Java Doc) public boolean isSerialised()(Code)(Java Doc) abstract public ScalarExpression newLiteral(QueryExpression qs, Object value)(Code)(Java Doc) abstract public ScalarExpression newScalarExpression(QueryExpression qs, LogicSetExpression te)(Code)(Java Doc) public void setBoolean(ObjectManager om, Object datastoreStatement, int[] exprIndex, boolean value)(Code)(Java Doc) public void setByte(ObjectManager om, Object datastoreStatement, int[] exprIndex, byte value)(Code)(Java Doc) public void setChar(ObjectManager om, Object datastoreStatement, int[] exprIndex, char value)(Code)(Java Doc) public void setDefault(ObjectManager om, Object datastoreStatement, int[] exprIndex)(Code)(Java Doc) public void setDouble(ObjectManager om, Object datastoreStatement, int[] exprIndex, double value)(Code)(Java Doc) public void setFieldInformation(AbstractMemberMetaData fmd, DatastoreContainerObject container)(Code)(Java Doc) public void setFloat(ObjectManager om, Object datastoreStatement, int[] exprIndex, float value)(Code)(Java Doc) public void setInt(ObjectManager om, Object datastoreStatement, int[] exprIndex, int value)(Code)(Java Doc) public void setLong(ObjectManager om, Object datastoreStatement, int[] exprIndex, long value)(Code)(Java Doc) public void setObject(ObjectManager om, Object datastoreStatement, int[] exprIndex, Object value, StateManager ownerSM, int ownerFieldNumber)(Code)(Java Doc) public void setObject(ObjectManager om, Object datastoreStatement, int[] exprIndex, Object value)(Code)(Java Doc) public void setReferenceMapping(JavaTypeMapping referenceMapping)(Code)(Java Doc) public void setRoleForField(int role)(Code)(Java Doc) public void setShort(ObjectManager om, Object datastoreStatement, int[] exprIndex, short value)(Code)(Java Doc) public void setString(ObjectManager om, Object datastoreStatement, int[] exprIndex, String value)(Code)(Java Doc)
|
|
|