|
|||||||||||
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.SingleFieldMapping
Simple mapping for a java field mapping to a single datastore field.
Field Summary | |
protected DatastoreContainerObject |
datastoreContainer
|
protected TypeInfo |
typeInfo
|
Fields inherited from class org.jpox.store.mapping.JavaTypeMapping |
datastoreMappings, dba, fmd, LOCALISER, referenceMapping, type |
Constructor Summary | |
SingleFieldMapping(DatastoreAdapter dba,
AbstractPropertyMetaData fmd,
DatastoreContainerObject datastoreContainer)
Constructor. |
|
SingleFieldMapping(DatastoreAdapter dba,
FieldMetaData fmd,
DatastoreContainerObject datastoreContainer,
boolean initDatastoreMappings)
Constructor. |
|
SingleFieldMapping(DatastoreAdapter dba,
java.lang.String type)
Constructor. |
Method Summary | |
boolean |
equals(java.lang.Object obj)
Equality operator |
boolean |
getBoolean(PersistenceManager pm,
java.lang.Object resultSet,
int[] exprIndex)
Obtains a value from resultSet
at position specified by exprIndex . |
byte |
getByte(PersistenceManager pm,
java.lang.Object resultSet,
int[] exprIndex)
Obtains a value from resultSet
at position specified by exprIndex . |
char |
getChar(PersistenceManager pm,
java.lang.Object resultSet,
int[] exprIndex)
Obtains a value from resultSet
at position specified by exprIndex . |
DatastoreContainerObject |
getDatastoreContainer()
Accessor for the datastore class (e.g in an RDBMS context, the Table) |
double |
getDouble(PersistenceManager pm,
java.lang.Object resultSet,
int[] exprIndex)
Obtains a value from resultSet
at position specified by exprIndex . |
float |
getFloat(PersistenceManager pm,
java.lang.Object resultSet,
int[] exprIndex)
Obtains a value from resultSet
at position specified by exprIndex . |
int |
getInt(PersistenceManager pm,
java.lang.Object resultSet,
int[] exprIndex)
Obtains a value from resultSet
at position specified by exprIndex . |
long |
getLong(PersistenceManager pm,
java.lang.Object resultSet,
int[] exprIndex)
Obtains a value from resultSet
at position specified by exprIndex . |
java.lang.Object |
getObject(PersistenceManager pm,
java.lang.Object resultSet,
int[] exprIndex)
Obtains a value from resultSet
at position specified by exprIndex . |
short |
getShort(PersistenceManager pm,
java.lang.Object resultSet,
int[] exprIndex)
Obtains a value from resultSet
at position specified by exprIndex . |
java.lang.String |
getString(PersistenceManager pm,
java.lang.Object resultSet,
int[] exprIndex)
Obtains a value from resultSet
at position specified by exprIndex . |
boolean |
hasValue()
Acccessor for whether the fixed value is set. |
boolean |
includeInFetchStatement()
Accessor for the string to put in any retrieval datastore statement for this field. |
boolean |
includeInInsertStatement()
This mapping is included in the insert statement. |
boolean |
includeInUpdateStatement()
This mapping is included in the update statement. |
protected void |
prepareDatastoreMapping()
Method to prepare a field mapping for use in the datastore. |
void |
setBoolean(PersistenceManager pm,
java.lang.Object preparedStatement,
int[] exprIndex,
boolean value)
Sets a value into preparedStatement
at position specified by exprIndex . |
void |
setByte(PersistenceManager pm,
java.lang.Object preparedStatement,
int[] exprIndex,
byte value)
Sets a value into preparedStatement
at position specified by exprIndex . |
void |
setChar(PersistenceManager pm,
java.lang.Object preparedStatement,
int[] exprIndex,
char value)
Sets a value into preparedStatement
at position specified by exprIndex . |
void |
setDouble(PersistenceManager pm,
java.lang.Object preparedStatement,
int[] exprIndex,
double value)
Sets a value into preparedStatement
at position specified by exprIndex . |
void |
setFloat(PersistenceManager pm,
java.lang.Object preparedStatement,
int[] exprIndex,
float value)
Sets a value into preparedStatement
at position specified by exprIndex . |
void |
setInt(PersistenceManager pm,
java.lang.Object preparedStatement,
int[] exprIndex,
int value)
Sets a value into preparedStatement
at position specified by exprIndex . |
void |
setLong(PersistenceManager pm,
java.lang.Object preparedStatement,
int[] exprIndex,
long value)
Sets a value into preparedStatement
at position specified by exprIndex . |
void |
setObject(PersistenceManager pm,
java.lang.Object preparedStatement,
int[] exprIndex,
java.lang.Object value)
Sets a value into preparedStatement
at position specified by exprIndex . |
void |
setShort(PersistenceManager pm,
java.lang.Object preparedStatement,
int[] exprIndex,
short value)
Sets a value into preparedStatement
at position specified by exprIndex . |
void |
setString(PersistenceManager pm,
java.lang.Object preparedStatement,
int[] exprIndex,
java.lang.String value)
Sets a value into preparedStatement
at position specified by exprIndex . |
Methods inherited from class org.jpox.store.mapping.JavaTypeMapping |
addDataStoreMapping, failureMessage, getDataStoreMapping, getDataStoreMappings, getFieldMetaData, getJavaType, getNumberOfDatastoreFields, getObject, getReferenceMapping, getSampleValue, getType, isNullable, newLiteral, newScalarExpression, setDefault, setObject, setReferenceMapping |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected TypeInfo typeInfo
protected DatastoreContainerObject datastoreContainer
Constructor Detail |
public SingleFieldMapping(DatastoreAdapter dba, java.lang.String type)
dba
- Datastore Adaptertype
- Type of the fieldpublic SingleFieldMapping(DatastoreAdapter dba, AbstractPropertyMetaData fmd, DatastoreContainerObject datastoreContainer)
dba
- Datastore Adapterfmd
- AbstractPropertyMetaData for the field being mappeddatastoreContainer
- Table containing the mapped objectpublic SingleFieldMapping(DatastoreAdapter dba, FieldMetaData fmd, DatastoreContainerObject datastoreContainer, boolean initDatastoreMappings)
dba
- Datastroe Adapterfmd
- FieldMetaData for the field to be mappeddatastoreContainer
- Table containing the mapped fieldinitDatastoreMappings
- Whether to initialise the datastore mappings (create the columns etc)Method Detail |
public boolean hasValue()
protected void prepareDatastoreMapping()
public DatastoreContainerObject getDatastoreContainer()
getDatastoreContainer
in class JavaTypeMapping
public boolean includeInFetchStatement()
includeInFetchStatement
in class JavaTypeMapping
public boolean includeInUpdateStatement()
includeInUpdateStatement
in class JavaTypeMapping
public boolean includeInInsertStatement()
includeInInsertStatement
in class JavaTypeMapping
public boolean equals(java.lang.Object obj)
obj
- The object to compare with
public void setBoolean(PersistenceManager pm, java.lang.Object preparedStatement, int[] exprIndex, boolean value)
JavaTypeMapping
value
into preparedStatement
at position specified by exprIndex
.
setBoolean
in class JavaTypeMapping
pm
- the PersistenceManagerpreparedStatement
- a datastore object that executes statements in the databaseexprIndex
- the position of the value in the statementvalue
- the valuepublic boolean getBoolean(PersistenceManager pm, java.lang.Object resultSet, int[] exprIndex)
JavaTypeMapping
resultSet
at position specified by exprIndex
.
getBoolean
in class JavaTypeMapping
pm
- the PersistenceManagerresultSet
- an object returned from the datastore with valuesexprIndex
- the position of the value in the result
public void setChar(PersistenceManager pm, java.lang.Object preparedStatement, int[] exprIndex, char value)
JavaTypeMapping
value
into preparedStatement
at position specified by exprIndex
.
setChar
in class JavaTypeMapping
pm
- the PersistenceManagerpreparedStatement
- a datastore object that executes statements in the databaseexprIndex
- the position of the value in the statementvalue
- the valuepublic char getChar(PersistenceManager pm, java.lang.Object resultSet, int[] exprIndex)
JavaTypeMapping
resultSet
at position specified by exprIndex
.
getChar
in class JavaTypeMapping
pm
- the PersistenceManagerresultSet
- an object returned from the datastore with valuesexprIndex
- the position of the value in the result
public void setByte(PersistenceManager pm, java.lang.Object preparedStatement, int[] exprIndex, byte value)
JavaTypeMapping
value
into preparedStatement
at position specified by exprIndex
.
setByte
in class JavaTypeMapping
pm
- the PersistenceManagerpreparedStatement
- a datastore object that executes statements in the databaseexprIndex
- the position of the value in the statementvalue
- the valuepublic byte getByte(PersistenceManager pm, java.lang.Object resultSet, int[] exprIndex)
JavaTypeMapping
resultSet
at position specified by exprIndex
.
getByte
in class JavaTypeMapping
pm
- the PersistenceManagerresultSet
- an object returned from the datastore with valuesexprIndex
- the position of the value in the result
public void setShort(PersistenceManager pm, java.lang.Object preparedStatement, int[] exprIndex, short value)
JavaTypeMapping
value
into preparedStatement
at position specified by exprIndex
.
setShort
in class JavaTypeMapping
pm
- the PersistenceManagerpreparedStatement
- a datastore object that executes statements in the databaseexprIndex
- the position of the value in the statementvalue
- the valuepublic short getShort(PersistenceManager pm, java.lang.Object resultSet, int[] exprIndex)
JavaTypeMapping
resultSet
at position specified by exprIndex
.
getShort
in class JavaTypeMapping
pm
- the PersistenceManagerresultSet
- an object returned from the datastore with valuesexprIndex
- the position of the value in the result
public void setInt(PersistenceManager pm, java.lang.Object preparedStatement, int[] exprIndex, int value)
JavaTypeMapping
value
into preparedStatement
at position specified by exprIndex
.
setInt
in class JavaTypeMapping
pm
- the PersistenceManagerpreparedStatement
- a datastore object that executes statements in the databaseexprIndex
- the position of the value in the statementvalue
- the valuepublic int getInt(PersistenceManager pm, java.lang.Object resultSet, int[] exprIndex)
JavaTypeMapping
resultSet
at position specified by exprIndex
.
getInt
in class JavaTypeMapping
pm
- the PersistenceManagerresultSet
- an object returned from the datastore with valuesexprIndex
- the position of the value in the result
public void setLong(PersistenceManager pm, java.lang.Object preparedStatement, int[] exprIndex, long value)
JavaTypeMapping
value
into preparedStatement
at position specified by exprIndex
.
setLong
in class JavaTypeMapping
pm
- the PersistenceManagerpreparedStatement
- a datastore object that executes statements in the databaseexprIndex
- the position of the value in the statementvalue
- the valuepublic long getLong(PersistenceManager pm, java.lang.Object resultSet, int[] exprIndex)
JavaTypeMapping
resultSet
at position specified by exprIndex
.
getLong
in class JavaTypeMapping
pm
- the PersistenceManagerresultSet
- an object returned from the datastore with valuesexprIndex
- the position of the value in the result
public void setFloat(PersistenceManager pm, java.lang.Object preparedStatement, int[] exprIndex, float value)
JavaTypeMapping
value
into preparedStatement
at position specified by exprIndex
.
setFloat
in class JavaTypeMapping
pm
- the PersistenceManagerpreparedStatement
- a datastore object that executes statements in the databaseexprIndex
- the position of the value in the statementvalue
- the valuepublic float getFloat(PersistenceManager pm, java.lang.Object resultSet, int[] exprIndex)
JavaTypeMapping
resultSet
at position specified by exprIndex
.
getFloat
in class JavaTypeMapping
pm
- the PersistenceManagerresultSet
- an object returned from the datastore with valuesexprIndex
- the position of the value in the result
public void setDouble(PersistenceManager pm, java.lang.Object preparedStatement, int[] exprIndex, double value)
JavaTypeMapping
value
into preparedStatement
at position specified by exprIndex
.
setDouble
in class JavaTypeMapping
pm
- the PersistenceManagerpreparedStatement
- a datastore object that executes statements in the databaseexprIndex
- the position of the value in the statementvalue
- the valuepublic double getDouble(PersistenceManager pm, java.lang.Object resultSet, int[] exprIndex)
JavaTypeMapping
resultSet
at position specified by exprIndex
.
getDouble
in class JavaTypeMapping
pm
- the PersistenceManagerresultSet
- an object returned from the datastore with valuesexprIndex
- the position of the value in the result
public void setString(PersistenceManager pm, java.lang.Object preparedStatement, int[] exprIndex, java.lang.String value)
JavaTypeMapping
value
into preparedStatement
at position specified by exprIndex
.
setString
in class JavaTypeMapping
pm
- the PersistenceManagerpreparedStatement
- a datastore object that executes statements in the databaseexprIndex
- the position of the value in the statementvalue
- the valuepublic java.lang.String getString(PersistenceManager pm, java.lang.Object resultSet, int[] exprIndex)
JavaTypeMapping
resultSet
at position specified by exprIndex
.
getString
in class JavaTypeMapping
pm
- the PersistenceManagerresultSet
- an object returned from the datastore with valuesexprIndex
- the position of the value in the result
public void setObject(PersistenceManager pm, java.lang.Object preparedStatement, int[] exprIndex, java.lang.Object value)
JavaTypeMapping
value
into preparedStatement
at position specified by exprIndex
.
setObject
in class JavaTypeMapping
pm
- the PersistenceManagerpreparedStatement
- a datastore object that executes statements in the databaseexprIndex
- the position of the value in the statementvalue
- the valuepublic java.lang.Object getObject(PersistenceManager pm, java.lang.Object resultSet, int[] exprIndex)
JavaTypeMapping
resultSet
at position specified by exprIndex
.
getObject
in class JavaTypeMapping
pm
- the PersistenceManagerresultSet
- an object returned from the datastore with valuesexprIndex
- the position of the value in the result
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |