public abstract class AbstractContainerMapping extends SingleFieldMapping
absFieldNumber, datastoreMappings, mmd, referenceMapping, roleForMember, storeMgr, table, type
Constructor and Description |
---|
AbstractContainerMapping() |
Modifier and Type | Method and Description |
---|---|
protected boolean |
containerIsStoredInSingleColumn()
Convenience method to return if the container (collection or map) is stored
in the owning table as a column.
|
DatastoreMapping |
getDatastoreMapping(int index)
Accessor for a datastore mapping
|
DatastoreMapping[] |
getDatastoreMappings()
Accessor for the datastore mappings for this java type
|
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
|
Object |
getObject(org.datanucleus.ExecutionContext ec,
ResultSet resultSet,
int[] exprIndex)
Method to retrieve an object from the passed JDBC ResultSet.
|
Table |
getTable()
Accessor for the datastore class.
|
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(org.datanucleus.metadata.AbstractMemberMetaData mmd,
Table table,
org.datanucleus.ClassLoaderResolver clr)
Initialize this JavaTypeMapping for the given field/property.
|
void |
postFetch(org.datanucleus.state.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 org.datanucleus.store.types.SCO |
replaceFieldWithWrapper(org.datanucleus.state.ObjectProvider op,
Object value)
Method to replace the field that this mapping represents with a SCO wrapper.
|
void |
setObject(org.datanucleus.ExecutionContext ec,
PreparedStatement ps,
int[] exprIndex,
Object value)
Method to set a field in the passed JDBC PreparedStatement using this mapping.
|
getBoolean, getByte, getChar, getDefaultLength, getDouble, getFloat, getInt, getLong, getShort, getString, getValidValues, setBoolean, setByte, setChar, setDouble, setFloat, setInt, setLong, setShort, setString
addDatastoreMapping, equals, failureMessage, getAbsoluteFieldNumber, getColumnMetaDataForMember, getJavaType, getMemberMetaData, getObject, getReferenceMapping, getRoleForMember, getStoreManager, getType, getValueForDatastoreMapping, hashCode, initialize, isNullable, isSerialised, representableAsStringLiteralInStatement, setAbsFieldNumber, setMemberMetaData, setObject, setReferenceMapping, setRoleForMember, setTable
public void initialize(org.datanucleus.metadata.AbstractMemberMetaData mmd, Table table, org.datanucleus.ClassLoaderResolver clr)
initialize
in class SingleFieldMapping
mmd
- MetaData for the field/property to be mapped (if any)table
- The datastore container storing this mapping (if any)clr
- the ClassLoaderResolverpublic boolean hasSimpleDatastoreRepresentation()
hasSimpleDatastoreRepresentation
in class JavaTypeMapping
protected void prepareDatastoreMapping()
prepareDatastoreMapping
in class SingleFieldMapping
public String getJavaTypeForDatastoreMapping(int index)
getJavaTypeForDatastoreMapping
in class SingleFieldMapping
index
- requested datastore field index.public void setObject(org.datanucleus.ExecutionContext ec, PreparedStatement ps, int[] exprIndex, Object value)
setObject
in class SingleFieldMapping
ec
- ExecutionContextps
- The JDBC Prepared Statement to be populatedexprIndex
- The parameter positions in the JDBC statement to populate.value
- The value to populate into itpublic Object getObject(org.datanucleus.ExecutionContext ec, ResultSet resultSet, int[] exprIndex)
getObject
in class SingleFieldMapping
ec
- ExecutionContextresultSet
- The ResultSetexprIndex
- The parameter position(s) to extract the object frompublic Table getTable()
getTable
in class JavaTypeMapping
public int getNumberOfDatastoreMappings()
getNumberOfDatastoreMappings
in class JavaTypeMapping
public DatastoreMapping getDatastoreMapping(int index)
getDatastoreMapping
in class JavaTypeMapping
index
- The id of the mappingpublic DatastoreMapping[] getDatastoreMappings()
getDatastoreMappings
in class JavaTypeMapping
protected boolean containerIsStoredInSingleColumn()
public boolean includeInFetchStatement()
includeInFetchStatement
in class JavaTypeMapping
public boolean includeInUpdateStatement()
includeInUpdateStatement
in class JavaTypeMapping
public boolean includeInInsertStatement()
includeInInsertStatement
in class JavaTypeMapping
protected org.datanucleus.store.types.SCO replaceFieldWithWrapper(org.datanucleus.state.ObjectProvider op, Object value)
op
- ObjectProvider for the owning objectvalue
- The value to create the wrapper withpublic void postFetch(org.datanucleus.state.ObjectProvider sm)
sm
- StateManager of the ownerCopyright © 2015. All rights reserved.