org.jpox.store.mapped.mapping
Class MultiMapping

java.lang.Object
  extended by org.jpox.store.mapped.mapping.JavaTypeMapping
      extended by org.jpox.store.mapped.mapping.MultiMapping
Direct Known Subclasses:
ReferenceMapping, SubclassPCMapping

public abstract class MultiMapping
extends JavaTypeMapping

Mapping to represent multiple mappings. This mapping can be used to represent, for example,

Version:
$Revision: 1.37 $

Field Summary
protected  JavaTypeMapping[] javaTypeMappings
          The Java mappings represented by this mapping.
 
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
MultiMapping()
           
 
Method Summary
 void addJavaTypeMapping(JavaTypeMapping mapping)
          Method to add a Java type mapping for a field
 DatastoreMapping getDataStoreMapping(int index)
          Accessor for a datastore mapping.
 JavaTypeMapping[] getJavaTypeMapping()
          Accessor for the Java type mappings
 int getNumberOfDatastoreFields()
          Accessor for the number of datastore fields.
 java.lang.Object getObject(ObjectManager om, java.lang.Object rs, int[] pos)
          Method to retrieve an object of this type from the ResultSet.
 void setObject(ObjectManager om, 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(ObjectManager om, 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.mapped.mapping.JavaTypeMapping
addDataStoreMapping, failureMessage, getBoolean, getByte, getChar, getDatastoreContainer, getDataStoreMappings, getDouble, getFieldMetaData, getFloat, getInt, getJavaType, getJavaTypeForDatastoreMapping, getLong, getObject, getReferenceMapping, getRoleForField, getSampleValue, getShort, getString, getType, includeInFetchStatement, includeInInsertStatement, includeInUpdateStatement, initialize, initialize, isNullable, isSerialised, newLiteral, newScalarExpression, setBoolean, setByte, setChar, setDefault, setDouble, setFieldInformation, setFloat, setInt, setLong, setReferenceMapping, setRoleForField, setShort, setString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

javaTypeMappings

protected JavaTypeMapping[] javaTypeMappings
The Java mappings represented by this mapping.

Constructor Detail

MultiMapping

public MultiMapping()
Method Detail

addJavaTypeMapping

public void addJavaTypeMapping(JavaTypeMapping mapping)
Method to add a Java type mapping for a field

Parameters:
mapping - The mapping to add

getJavaTypeMapping

public JavaTypeMapping[] getJavaTypeMapping()
Accessor for the Java type mappings

Returns:
The Java type mappings

getNumberOfDatastoreFields

public int getNumberOfDatastoreFields()
Accessor for the number of datastore fields.

Overrides:
getNumberOfDatastoreFields in class JavaTypeMapping
Returns:
The number of datastore fields.

getDataStoreMapping

public DatastoreMapping getDataStoreMapping(int index)
Accessor for a datastore mapping.

Overrides:
getDataStoreMapping in class JavaTypeMapping
Parameters:
index - The position of the mapping to return
Returns:
The datastore mapping

setObject

public void setObject(ObjectManager om,
                      java.lang.Object ps,
                      int[] pos,
                      java.lang.Object value)
Method to set the parameters in the PreparedStatement with the fields of this object.

Overrides:
setObject in class JavaTypeMapping
Parameters:
om - Object Manager
ps - The PreparedStatement
pos - The parameter positions
value - The object to populate the statement with
Throws:
NotYetFlushedException - Thrown if the object is not yet flushed to the datastore

setObject

public void setObject(ObjectManager om,
                      java.lang.Object ps,
                      int[] pos,
                      java.lang.Object value,
                      StateManager ownerSM,
                      int ownerFieldNumber)
Sets a value into preparedStatement at position specified by exprIndex.

Overrides:
setObject in class JavaTypeMapping
Parameters:
om - the ObjectManager
ps - a datastore object that executes statements in the database
pos - the position of the value in the statement
value - the value
ownerSM - the owner StateManager
ownerFieldNumber - the owner absolute field number

getObject

public java.lang.Object getObject(ObjectManager om,
                                  java.lang.Object rs,
                                  int[] pos)
Method to retrieve an object of this type from the ResultSet.

Overrides:
getObject in class JavaTypeMapping
Parameters:
om - Object Manager
rs - The ResultSet
pos - The parameter positions
Returns:
The object


Copyright © -2008 . All Rights Reserved.