|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jpox.store.mapped.mapping.JavaTypeMapping
org.jpox.store.mapped.mapping.SingleFieldMapping
org.jpox.store.mapped.mapping.OIDMapping
org.jpox.store.mapped.mapping.PersistenceCapableMapping
public class PersistenceCapableMapping
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
| Field Summary | |
|---|---|
protected JavaTypeMapping[] |
javaTypeMappings
Mappings for all fields necessary to represent the id of the PC object. |
| Fields inherited from class org.jpox.store.mapped.mapping.JavaTypeMapping |
|---|
datastoreContainer, datastoreMappings, dba, fmd, LOCALISER, MAPPING_ARRAY_ELEMENT, MAPPING_COLLECTION_ELEMENT, MAPPING_FIELD, MAPPING_MAP_KEY, MAPPING_MAP_VALUE, referenceMapping, roleForField, type |
| Constructor Summary | |
|---|---|
PersistenceCapableMapping()
Create a new empty PersistenceCapableMapping. |
|
| Method Summary | |
|---|---|
void |
addJavaTypeMapping(JavaTypeMapping mapping)
Add a new JavaTypeMapping |
DatastoreMapping |
getDataStoreMapping(int index)
Accessor for a datastore mapping. |
JavaTypeMapping[] |
getJavaTypeMapping()
Accessor for the Java type mappings |
int |
getNumberOfDatastoreFields()
Accessor for the number of datastore fields. |
java.lang.Object |
getObject(ObjectManager om,
java.lang.Object rs,
int[] param)
Returns a instance of a PersistenceCapable class. |
void |
initialize(DatastoreAdapter dba,
AbstractMemberMetaData fmd,
DatastoreContainerObject container,
ClassLoaderResolver clr)
Initialize this JavaTypeMapping with the given DatastoreAdapter for the given FieldMetaData. |
ScalarExpression |
newLiteral(QueryExpression qs,
java.lang.Object value)
Creates a literal from an value. |
ScalarExpression |
newScalarExpression(QueryExpression qs,
LogicSetExpression te)
Creates a expression from a field name/table. |
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. |
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. |
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. |
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. |
void |
setObject(ObjectManager om,
java.lang.Object ps,
int[] param,
java.lang.Object value)
Method to set an object in the datastore. |
void |
setObject(ObjectManager om,
java.lang.Object ps,
int[] param,
java.lang.Object value,
StateManager ownerSM,
int ownerFieldNumber)
Method to set an object reference (FK) in the datastore. |
| Methods inherited from class org.jpox.store.mapped.mapping.OIDMapping |
|---|
getJavaType, getSampleValue |
| Methods inherited from class org.jpox.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.jpox.store.mapped.mapping.JavaTypeMapping |
|---|
addDataStoreMapping, failureMessage, getDatastoreContainer, getDataStoreMappings, getFieldMetaData, getObject, getReferenceMapping, getRoleForField, getType, includeInFetchStatement, includeInInsertStatement, includeInUpdateStatement, initialize, isNullable, isSerialised, setDefault, setFieldInformation, setReferenceMapping, setRoleForField |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected JavaTypeMapping[] javaTypeMappings
| Constructor Detail |
|---|
public PersistenceCapableMapping()
| Method Detail |
|---|
public void initialize(DatastoreAdapter dba,
AbstractMemberMetaData fmd,
DatastoreContainerObject container,
ClassLoaderResolver clr)
initialize in class SingleFieldMappingdba - The Datastore Adapter that this Mapping should use.fmd - FieldMetaData for the field to be mapped (if any)container - The datastore container storing this mapping (if any)clr - the ClassLoaderResolverpublic void addJavaTypeMapping(JavaTypeMapping mapping)
mapping - the JavaTypeMappingprotected void prepareDatastoreMapping()
prepareDatastoreMapping in class SingleFieldMappingprotected void prepareDatastoreMapping(ClassLoaderResolver clr)
clr - The ClassLoaderResolverpublic JavaTypeMapping[] getJavaTypeMapping()
public int getNumberOfDatastoreFields()
getNumberOfDatastoreFields in class JavaTypeMappingpublic DatastoreMapping getDataStoreMapping(int index)
getDataStoreMapping in class JavaTypeMappingindex - The position of the mapping.
public void setObject(ObjectManager om,
java.lang.Object ps,
int[] param,
java.lang.Object value)
setObject in class OIDMappingom - The ObjectManagerps - The Prepared Statementparam - The parameter ids in the statementvalue - The value to put in the statement at these ids
NotYetFlushedException
public void setObject(ObjectManager om,
java.lang.Object ps,
int[] param,
java.lang.Object value,
StateManager ownerSM,
int ownerFieldNumber)
setObject in class JavaTypeMappingom - The Object Managerps - The Prepared Statementparam - The parameter ids in the statementvalue - The value to put in the statement at these idsownerSM - StateManager for the owner objectownerFieldNumber - Field number of this PC object in the owner
NotYetFlushedException
public java.lang.Object getObject(ObjectManager om,
java.lang.Object rs,
int[] param)
getObject in class OIDMappingom - The Object Managerrs - The ResultSetparam - Array of parameter ids in the ResultSet to retrieve
public ScalarExpression newLiteral(QueryExpression qs,
java.lang.Object value)
JavaTypeMapping
newLiteral in class OIDMappingqs - The Query statementvalue - The object
public ScalarExpression newScalarExpression(QueryExpression qs,
LogicSetExpression te)
JavaTypeMapping
newScalarExpression in class OIDMappingqs - The Query statementte - the alias for the table
public void postFetch(StateManager sm)
postFetch in interface MappingCallbackssm - StateManager for the owner.public void postInsert(StateManager sm)
postInsert in interface MappingCallbackssm - StateManager for the ownerpublic void postUpdate(StateManager sm)
postUpdate in interface MappingCallbackssm - StateManager for the ownerpublic void preDelete(StateManager sm)
preDelete in interface MappingCallbackssm - StateManager for the owner
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||