|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.datanucleus.store.mapped.mapping.JavaTypeMapping
org.datanucleus.store.mapped.mapping.SingleFieldMapping
org.datanucleus.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 |
|---|
| Fields inherited from class org.datanucleus.store.mapped.mapping.JavaTypeMapping |
|---|
datastoreContainer, datastoreMappings, LOCALISER, mmd, referenceMapping, roleForMember, storeMgr, 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 |
getNumberOfDatastoreMappings()
Accessor for the number of datastore fields |
java.lang.Object |
getObject(ExecutionContext ec,
java.lang.Object resultSet,
int[] exprIndex)
Method to retrieve an object from the passed JDBC ResultSet. |
boolean |
hasSimpleDatastoreRepresentation()
Whether the mapping has a simple (single column) datastore representation. |
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(AbstractMemberMetaData mmd,
DatastoreContainerObject container,
ClassLoaderResolver clr)
Initialize this JavaTypeMapping for the given field/property. |
void |
postFetch(ObjectProvider 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(ObjectProvider ownerSM,
java.lang.Object value,
boolean forInsert,
boolean forUpdate)
Method to replace the field that this mapping represents with a SCO wrapper. |
void |
setObject(ExecutionContext ec,
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.datanucleus.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.datanucleus.store.mapped.mapping.JavaTypeMapping |
|---|
addDatastoreMapping, failureMessage, getColumnMetaDataForMember, getJavaType, getMemberMetaData, getObject, getReferenceMapping, getRoleForMember, getType, getValueForDatastoreMapping, hashCode, initialize, isNullable, isSerialised, setDatastoreContainer, setMemberMetaData, setObject, setReferenceMapping, setRoleForMember |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AbstractContainerMapping()
| Method Detail |
|---|
public void initialize(AbstractMemberMetaData mmd,
DatastoreContainerObject container,
ClassLoaderResolver clr)
initialize in class SingleFieldMappingmmd - MetaData for the field/property to be mapped (if any)container - The datastore container storing this mapping (if any)clr - the ClassLoaderResolverpublic boolean hasSimpleDatastoreRepresentation()
hasSimpleDatastoreRepresentation in class JavaTypeMappingprotected void prepareDatastoreMapping()
prepareDatastoreMapping in class SingleFieldMappingpublic java.lang.String getJavaTypeForDatastoreMapping(int index)
getJavaTypeForDatastoreMapping in class SingleFieldMappingindex - requested datastore field index.
public void setObject(ExecutionContext ec,
java.lang.Object preparedStatement,
int[] exprIndex,
java.lang.Object value)
setObject in class SingleFieldMappingec - ExecutionContextpreparedStatement - 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(ExecutionContext ec,
java.lang.Object resultSet,
int[] exprIndex)
getObject in class SingleFieldMappingec - ExecutionContextresultSet - The ResultSetexprIndex - The parameter position(s) to extract the object from
public DatastoreContainerObject getDatastoreContainer()
getDatastoreContainer in class JavaTypeMappingpublic int getNumberOfDatastoreMappings()
getNumberOfDatastoreMappings 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 JavaTypeMapping
protected SCO replaceFieldWithWrapper(ObjectProvider 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(ObjectProvider sm)
sm - StateManager of the owner
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||