| java.lang.Object org.jpox.store.mapping.JavaTypeMapping org.jpox.store.mapping.SingleFieldMapping org.jpox.store.mapping.AbstractContainerMapping
All known Subclasses: org.jpox.store.mapping.MapMapping, org.jpox.store.mapping.ArrayMapping, org.jpox.store.mapping.CollectionMapping,
AbstractContainerMapping | abstract public class AbstractContainerMapping extends SingleFieldMapping (Code) | | Mapping for a field that represents a container of objects, such as a List,
a Set, a Collection, a Map, or an array. Has an owner table.
Can be represented in the following ways :-
- Using a Join-Table, where the linkage between owner and elements/keys/values is stored in this table
- Using a Foreign-Key in the element/key/value
- Serialised into a single column in the owner table.
- Embedded into the Join-Table
- Serialised into a single-column in the Join-Table
The contents of the container are backed by a store, handling interfacing with the datastore.
version: $Revision: 1.50 $ |
Method Summary | |
protected boolean | containerIsStoredInSingleColumn() Convenience method to return if the container (collection or map) is stored
in the owning table as a column. | public DatastoreMapping | getDataStoreMapping(int index) | public DatastoreMapping[] | getDataStoreMappings() | public DatastoreContainerObject | getDatastoreContainer() Accessor for the datastore class. | public String | getJavaTypeForDatastoreMapping(int index) Accessor for the name of the java-type actually used when mapping the particular datastore
field. | public int | getNumberOfDatastoreFields() | public Object | getObject(ObjectManager om, Object resultSet, int[] exprIndex) Method to retrieve an object from the passed JDBC ResultSet. | public Object | getSampleValue(ClassLoaderResolver clr) Accessor for a sample value for this mapping. | public int | hashCode() Hash code function. | public boolean | includeInFetchStatement() This mapping is included in the select statement. | public boolean | includeInInsertStatement() This mapping is included in the insert statement. | public boolean | includeInUpdateStatement() This mapping is included in the update statement. | public void | initialize(DatastoreAdapter dba, AbstractMemberMetaData fmd, DatastoreContainerObject container, ClassLoaderResolver clr) Initialize this JavaTypeMapping with the given DatastoreAdapter for
the given FieldMetaData. | public void | postFetch(StateManager sm) Method to be called after any fetch of the owner class element. | protected void | prepareDatastoreMapping() Method to prepare a field mapping for use in the datastore. | protected SCO | replaceFieldWithWrapper(StateManager ownerSM, Object value, boolean forInsert, boolean forUpdate) Method to replace the field that this mapping represents with a SCO wrapper. | public void | setObject(ObjectManager om, Object preparedStatement, int[] exprIndex, Object value) Method to set a field in the passed JDBC PreparedStatement using this mapping. |
fieldName | protected String fieldName(Code) | | Name of the field that is the container.
|
containerIsStoredInSingleColumn | protected boolean containerIsStoredInSingleColumn()(Code) | | Convenience method to return if the container (collection or map) is stored
in the owning table as a column. The container is stored in a single column in the following situations :-
- The FieldMetaData has 'serialized="true"'
- The collection has embedded-element="true" but no join table (and so serialised)
- The map has embedded-key/value="true" but no join table (and so serialised)
- The array has embedded-element="true" but no join table (and so serialised)
- The array has no join table and non-PC elements (and so serialised)
Whether it is stored in a single column in the main table. |
getDataStoreMapping | public DatastoreMapping getDataStoreMapping(int index)(Code) | | Accessor for a datastore mapping
Parameters: index - The id of the mapping The datastore mapping |
getDataStoreMappings | public DatastoreMapping[] getDataStoreMappings()(Code) | | Accessor for the datastore mappings for this java type
The datastore mapping(s) |
getJavaTypeForDatastoreMapping | public String getJavaTypeForDatastoreMapping(int index)(Code) | | Accessor for the name of the java-type actually used when mapping the particular datastore
field. This java-type must have an entry in the datastore mappings.
Parameters: index - requested datastore field index. the name of java-type for the requested datastore field. |
getNumberOfDatastoreFields | public int getNumberOfDatastoreFields()(Code) | | Accessor for the number of datastore fields
The number of datastore fields |
getObject | public Object getObject(ObjectManager om, Object resultSet, int[] exprIndex)(Code) | | Method to retrieve an object from the passed JDBC ResultSet.
Only valid when the collection is serialised.
Parameters: om - Object Manager Parameters: resultSet - The JDBC ResultSet Parameters: exprIndex - The JDBC parameter position(s) to extract the object from The collection object |
hashCode | public int hashCode()(Code) | | Hash code function.
The hash code for this object |
includeInFetchStatement | public boolean includeInFetchStatement()(Code) | | This mapping is included in the select statement.
Whether to include in select statement |
includeInInsertStatement | public boolean includeInInsertStatement()(Code) | | This mapping is included in the insert statement.
Whether to include in insert statement |
includeInUpdateStatement | public boolean includeInUpdateStatement()(Code) | | This mapping is included in the update statement.
Whether to include in update statement |
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 to be called after any fetch of the owner class element.
Parameters: sm - StateManager of the owner |
prepareDatastoreMapping | protected void prepareDatastoreMapping()(Code) | | Method to prepare a field mapping for use in the datastore.
This creates the column in the table.
|
replaceFieldWithWrapper | protected SCO replaceFieldWithWrapper(StateManager ownerSM, Object value, boolean forInsert, boolean forUpdate)(Code) | | Method to replace the field that this mapping represents with a SCO wrapper.
The wrapper will be suitable for the passed instantiated type and if it is null will be for
the declared type of the field.
Parameters: ownerSM - State Manager for the owning object Parameters: value - The value to create the wrapper with Parameters: forInsert - Whether to insert the SCO with this value Parameters: forUpdate - Whether to update the SCO with this value The SCO wrapper object that the field was replaced with |
setObject | public void setObject(ObjectManager om, Object preparedStatement, int[] exprIndex, Object value)(Code) | | Method to set a field in the passed JDBC PreparedStatement using this mapping.
Only valid when the collection is serialised.
Parameters: om - The Object Manager Parameters: preparedStatement - The JDBC Prepared Statement to be populated Parameters: exprIndex - The parameter positions in the JDBC statement to populate. Parameters: value - The value to populate into it |
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)
|
|
|