|
||||||||||
| 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.AbstractContainerMapping
public abstract class AbstractContainerMapping
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 :-
| Field Summary | |
|---|---|
protected java.lang.String |
fieldName
Name of the field that is the container. |
protected MappedStoreManager |
storeMgr
Store Manager being used. |
| 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 | |
|---|---|
AbstractContainerMapping()
|
|
| Method Summary | |
|---|---|
protected boolean |
containerIsStoredInSingleColumn()
Convenience method to return if the container (collection or map) is stored in the owning table as a column. |
DatastoreContainerObject |
getDatastoreContainer()
Accessor for the datastore class. |
DatastoreMapping |
getDataStoreMapping(int index)
Accessor for a datastore mapping |
DatastoreMapping[] |
getDataStoreMappings()
Accessor for the datastore mappings for this java type |
java.lang.String |
getJavaTypeForDatastoreMapping(int index)
Accessor for the name of the java-type actually used when mapping the particular datastore field. |
int |
getNumberOfDatastoreFields()
Accessor for the number of datastore fields |
java.lang.Object |
getObject(ObjectManager om,
java.lang.Object resultSet,
int[] exprIndex)
Method to retrieve an object from the passed JDBC ResultSet. |
java.lang.Object |
getSampleValue(ClassLoaderResolver clr)
Accessor for a sample value for this mapping. |
int |
hashCode()
Hash code function. |
boolean |
includeInFetchStatement()
This mapping is included in the select statement. |
boolean |
includeInInsertStatement()
This mapping is included in the insert statement. |
boolean |
includeInUpdateStatement()
This mapping is included in the update statement. |
void |
initialize(DatastoreAdapter dba,
AbstractMemberMetaData fmd,
DatastoreContainerObject container,
ClassLoaderResolver clr)
Initialize this JavaTypeMapping with the given DatastoreAdapter for the given FieldMetaData. |
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,
java.lang.Object value,
boolean forInsert,
boolean forUpdate)
Method to replace the field that this mapping represents with a SCO wrapper. |
void |
setObject(ObjectManager om,
java.lang.Object preparedStatement,
int[] exprIndex,
java.lang.Object value)
Method to set a field in the passed JDBC PreparedStatement using this mapping. |
| Methods inherited from class org.jpox.store.mapped.mapping.SingleFieldMapping |
|---|
equals, getBoolean, getByte, getChar, getDefaultLength, getDouble, getFloat, getInt, 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, getFieldMetaData, getJavaType, getObject, getReferenceMapping, getRoleForField, getType, initialize, isNullable, isSerialised, newLiteral, newScalarExpression, setDefault, setFieldInformation, setObject, setReferenceMapping, setRoleForField |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected java.lang.String fieldName
protected MappedStoreManager storeMgr
| Constructor Detail |
|---|
public AbstractContainerMapping()
| 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 ClassLoaderResolverprotected void prepareDatastoreMapping()
prepareDatastoreMapping in class SingleFieldMappingpublic java.lang.String getJavaTypeForDatastoreMapping(int index)
getJavaTypeForDatastoreMapping in class SingleFieldMappingindex - requested datastore field index.
public void setObject(ObjectManager om,
java.lang.Object preparedStatement,
int[] exprIndex,
java.lang.Object value)
setObject in class SingleFieldMappingom - The Object ManagerpreparedStatement - The JDBC Prepared Statement to be populatedexprIndex - The parameter positions in the JDBC statement to populate.value - The value to populate into it
public java.lang.Object getObject(ObjectManager om,
java.lang.Object resultSet,
int[] exprIndex)
getObject in class SingleFieldMappingom - Object ManagerresultSet - The JDBC ResultSetexprIndex - The JDBC parameter position(s) to extract the object from
public DatastoreContainerObject getDatastoreContainer()
getDatastoreContainer in class JavaTypeMappingpublic int getNumberOfDatastoreFields()
getNumberOfDatastoreFields in class JavaTypeMappingpublic DatastoreMapping getDataStoreMapping(int index)
getDataStoreMapping in class JavaTypeMappingindex - The id of the mapping
public DatastoreMapping[] getDataStoreMappings()
getDataStoreMappings in class JavaTypeMappingprotected boolean containerIsStoredInSingleColumn()
public boolean includeInFetchStatement()
includeInFetchStatement in class JavaTypeMappingpublic boolean includeInUpdateStatement()
includeInUpdateStatement in class JavaTypeMappingpublic boolean includeInInsertStatement()
includeInInsertStatement in class JavaTypeMappingpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.Object getSampleValue(ClassLoaderResolver clr)
getSampleValue in class JavaTypeMappingclr - TODO
protected SCO replaceFieldWithWrapper(StateManager ownerSM,
java.lang.Object value,
boolean forInsert,
boolean forUpdate)
ownerSM - State Manager for the owning objectvalue - The value to create the wrapper withforInsert - Whether to insert the SCO with this valueforUpdate - Whether to update the SCO with this value
public void postFetch(StateManager sm)
sm - StateManager of the owner
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||