|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jpox.store.mapping.JavaTypeMapping
org.jpox.store.mapping.MultiMapping
Mapping to represent multiple mappings. This mapping can be used to represent, for example,
Field Summary | |
protected DatastoreContainerObject |
datastoreContainer
The datastore container storing this mapping. |
protected java.util.List |
javaTypeMappings
The Java mappings represented by this mapping. |
Fields inherited from class org.jpox.store.mapping.JavaTypeMapping |
datastoreMappings, dba, fmd, LOCALISER, referenceMapping, type |
Constructor Summary | |
MultiMapping(DatastoreAdapter dba,
AbstractPropertyMetaData fmd,
DatastoreContainerObject datastoreContainer)
Constructor. |
|
MultiMapping(DatastoreAdapter dba,
java.lang.String type)
Constructor. |
Method Summary | |
void |
addJavaTypeMapping(JavaTypeMapping mapping)
Method to add a Java type mapping for a field |
DatastoreContainerObject |
getDatastoreContainer()
Accessor for the datastore class (e.g in an RDBMS context, the Table) |
DatastoreMapping |
getDataStoreMapping(int index)
Accessor for a datastore mapping. |
java.util.List |
getJavaTypeMapping()
Accessor for the Java type mappings |
int |
getNumberOfDatastoreFields()
Accessor for the number of datastore fields. |
java.lang.Object |
getObject(PersistenceManager pm,
java.lang.Object rs,
int[] pos)
Method to retrieve an object of this type from the ResultSet. |
boolean |
includeInFetchStatement()
Accessor for whether this mapping is to be included in any fetch statement. |
boolean |
includeInInsertStatement()
Accessor for whether this mapping is to be included in the insert statement. |
boolean |
includeInUpdateStatement()
Accessor for whether this mapping is to be included in the update statement. |
void |
setObject(PersistenceManager pm,
java.lang.Object ps,
int[] pos,
java.lang.Object value)
Method to set the parameters in the PreparedStatement with the fields of this object. |
void |
setObject(PersistenceManager pm,
java.lang.Object ps,
int[] pos,
java.lang.Object value,
StateManager ownerSM,
int ownerFieldNumber)
Sets a value into preparedStatement
at position specified by exprIndex . |
Methods inherited from class org.jpox.store.mapping.JavaTypeMapping |
addDataStoreMapping, failureMessage, getBoolean, getByte, getChar, getDataStoreMappings, getDouble, getFieldMetaData, getFloat, getInt, getJavaType, getLong, getObject, getReferenceMapping, getSampleValue, getShort, getString, getType, isNullable, newLiteral, newScalarExpression, setBoolean, setByte, setChar, setDefault, setDouble, setFloat, setInt, setLong, setReferenceMapping, setShort, setString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected DatastoreContainerObject datastoreContainer
protected java.util.List javaTypeMappings
Constructor Detail |
public MultiMapping(DatastoreAdapter dba, java.lang.String type)
dba
- Datastore Adaptertype
- Type of the fieldpublic MultiMapping(DatastoreAdapter dba, AbstractPropertyMetaData fmd, DatastoreContainerObject datastoreContainer)
dba
- Datastore Adapterfmd
- AbstractPropertyMetaData for the field being mappeddatastoreContainer
- Table containing the mapped objectMethod Detail |
public DatastoreContainerObject getDatastoreContainer()
getDatastoreContainer
in class JavaTypeMapping
public void addJavaTypeMapping(JavaTypeMapping mapping)
mapping
- The mapping to addpublic java.util.List getJavaTypeMapping()
public int getNumberOfDatastoreFields()
getNumberOfDatastoreFields
in class JavaTypeMapping
public DatastoreMapping getDataStoreMapping(int index)
getDataStoreMapping
in class JavaTypeMapping
index
- The position of the mapping to return
public boolean includeInFetchStatement()
includeInFetchStatement
in class JavaTypeMapping
public boolean includeInUpdateStatement()
includeInUpdateStatement
in class JavaTypeMapping
public boolean includeInInsertStatement()
includeInInsertStatement
in class JavaTypeMapping
public void setObject(PersistenceManager pm, java.lang.Object ps, int[] pos, java.lang.Object value)
setObject
in class JavaTypeMapping
pm
- Persistence Managerps
- The PreparedStatementpos
- The parameter positionsvalue
- The object to populate the statement with
NotYetFlushedException
- Thrown if the object is not yet flushed to the datastorepublic void setObject(PersistenceManager pm, java.lang.Object ps, int[] pos, java.lang.Object value, StateManager ownerSM, int ownerFieldNumber)
value
into preparedStatement
at position specified by exprIndex
.
setObject
in class JavaTypeMapping
pm
- the PersistenceManagerps
- a datastore object that executes statements in the databasepos
- the position of the value in the statementvalue
- the valueownerSM
- the owner StateManagerownerFieldNumber
- the owner absolute field numberpublic java.lang.Object getObject(PersistenceManager pm, java.lang.Object rs, int[] pos)
getObject
in class JavaTypeMapping
pm
- Persistence Managerrs
- The ResultSetpos
- The parameter positions
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |