public abstract class SingleFieldMapping extends JavaTypeMapping
absFieldNumber, datastoreMappings, mmd, referenceMapping, roleForMember, storeMgr, table, type
Constructor and Description |
---|
SingleFieldMapping() |
Modifier and Type | Method and Description |
---|---|
boolean |
getBoolean(org.datanucleus.ExecutionContext ec,
ResultSet resultSet,
int[] exprIndex)
Obtains a value from
datastoreResults
at position specified by exprIndex . |
byte |
getByte(org.datanucleus.ExecutionContext ec,
ResultSet resultSet,
int[] exprIndex)
Obtains a value from
datastoreResults
at position specified by exprIndex . |
char |
getChar(org.datanucleus.ExecutionContext ec,
ResultSet resultSet,
int[] exprIndex)
Obtains a value from
datastoreResults
at position specified by exprIndex . |
int |
getDefaultLength(int index)
Accessor for the default length for this type in the datastore (if applicable).
|
double |
getDouble(org.datanucleus.ExecutionContext ec,
ResultSet resultSet,
int[] exprIndex)
Obtains a value from
datastoreResults
at position specified by exprIndex . |
float |
getFloat(org.datanucleus.ExecutionContext ec,
ResultSet resultSet,
int[] exprIndex)
Obtains a value from
datastoreResults
at position specified by exprIndex . |
int |
getInt(org.datanucleus.ExecutionContext ec,
ResultSet resultSet,
int[] exprIndex)
Obtains a value from
datastoreResults
at position specified by exprIndex . |
String |
getJavaTypeForDatastoreMapping(int index)
Accessor for the name of the java-type actually used when mapping the particular datastore
field.
|
long |
getLong(org.datanucleus.ExecutionContext ec,
ResultSet resultSet,
int[] exprIndex)
Obtains a value from
datastoreResults
at position specified by exprIndex . |
Object |
getObject(org.datanucleus.ExecutionContext ec,
ResultSet resultSet,
int[] exprIndex)
Obtains a value from
datastoreResults
at position specified by exprIndex . |
short |
getShort(org.datanucleus.ExecutionContext ec,
ResultSet resultSet,
int[] exprIndex)
Obtains a value from
datastoreResults
at position specified by exprIndex . |
String |
getString(org.datanucleus.ExecutionContext ec,
ResultSet resultSet,
int[] exprIndex)
Obtains a value from
datastoreResults
at position specified by exprIndex . |
Object[] |
getValidValues(int index)
Accessor for an array of valid values that this type can take.
|
void |
initialize(org.datanucleus.metadata.AbstractMemberMetaData fmd,
Table table,
org.datanucleus.ClassLoaderResolver clr)
Initialize this JavaTypeMapping with the given DatastoreAdapter for the given FieldMetaData.
|
protected void |
prepareDatastoreMapping()
Method to prepare a field mapping for use in the datastore.
|
void |
setBoolean(org.datanucleus.ExecutionContext ec,
PreparedStatement ps,
int[] exprIndex,
boolean value)
Sets a
value into datastoreStatement
at position specified by exprIndex . |
void |
setByte(org.datanucleus.ExecutionContext ec,
PreparedStatement ps,
int[] exprIndex,
byte value)
Sets a
value into datastoreStatement
at position specified by exprIndex . |
void |
setChar(org.datanucleus.ExecutionContext ec,
PreparedStatement ps,
int[] exprIndex,
char value)
Sets a
value into datastoreStatement
at position specified by exprIndex . |
void |
setDouble(org.datanucleus.ExecutionContext ec,
PreparedStatement ps,
int[] exprIndex,
double value)
Sets a
value into datastoreStatement
at position specified by exprIndex . |
void |
setFloat(org.datanucleus.ExecutionContext ec,
PreparedStatement ps,
int[] exprIndex,
float value)
Sets a
value into datastoreStatement
at position specified by exprIndex . |
void |
setInt(org.datanucleus.ExecutionContext ec,
PreparedStatement ps,
int[] exprIndex,
int value)
Sets a
value into datastoreStatement
at position specified by exprIndex . |
void |
setLong(org.datanucleus.ExecutionContext ec,
PreparedStatement ps,
int[] exprIndex,
long value)
Sets a
value into datastoreStatement
at position specified by exprIndex . |
void |
setObject(org.datanucleus.ExecutionContext ec,
PreparedStatement ps,
int[] exprIndex,
Object value)
Sets a
value into datastoreStatement
at position specified by exprIndex . |
void |
setShort(org.datanucleus.ExecutionContext ec,
PreparedStatement ps,
int[] exprIndex,
short value)
Sets a
value into datastoreStatement
at position specified by exprIndex . |
void |
setString(org.datanucleus.ExecutionContext ec,
PreparedStatement ps,
int[] exprIndex,
String value)
Sets a
value into datastoreStatement
at position specified by exprIndex . |
addDatastoreMapping, equals, failureMessage, getAbsoluteFieldNumber, getColumnMetaDataForMember, getDatastoreMapping, getDatastoreMappings, getJavaType, getMemberMetaData, getNumberOfDatastoreMappings, getObject, getReferenceMapping, getRoleForMember, getStoreManager, getTable, getType, getValueForDatastoreMapping, hashCode, hasSimpleDatastoreRepresentation, includeInFetchStatement, includeInInsertStatement, includeInUpdateStatement, initialize, isNullable, isSerialised, representableAsStringLiteralInStatement, setAbsFieldNumber, setMemberMetaData, setObject, setReferenceMapping, setRoleForMember, setTable
public void initialize(org.datanucleus.metadata.AbstractMemberMetaData fmd, Table table, org.datanucleus.ClassLoaderResolver clr)
initialize
in class JavaTypeMapping
table
- The datastore container storing this mapping (if any)clr
- the ClassLoaderResolverfmd
- FieldMetaData for the field to be mapped (if any)protected void prepareDatastoreMapping()
public int getDefaultLength(int index)
index
- requested datastore field index.public Object[] getValidValues(int index)
index
- requested datastore field index.public String getJavaTypeForDatastoreMapping(int index)
getJavaTypeForDatastoreMapping
in class JavaTypeMapping
index
- requested datastore field index.public void setBoolean(org.datanucleus.ExecutionContext ec, PreparedStatement ps, int[] exprIndex, boolean value)
JavaTypeMapping
value
into datastoreStatement
at position specified by exprIndex
.setBoolean
in class JavaTypeMapping
ec
- ExecutionContextps
- PreparedStatementexprIndex
- the position of the value in the statementvalue
- the valuepublic boolean getBoolean(org.datanucleus.ExecutionContext ec, ResultSet resultSet, int[] exprIndex)
JavaTypeMapping
datastoreResults
at position specified by exprIndex
.getBoolean
in class JavaTypeMapping
ec
- ExecutionContextresultSet
- ResultSetexprIndex
- the position of the value in the resultpublic void setChar(org.datanucleus.ExecutionContext ec, PreparedStatement ps, int[] exprIndex, char value)
JavaTypeMapping
value
into datastoreStatement
at position specified by exprIndex
.setChar
in class JavaTypeMapping
ec
- ExecutionContextps
- PreparedStatementexprIndex
- the position of the value in the statementvalue
- the valuepublic char getChar(org.datanucleus.ExecutionContext ec, ResultSet resultSet, int[] exprIndex)
JavaTypeMapping
datastoreResults
at position specified by exprIndex
.getChar
in class JavaTypeMapping
ec
- ExecutionContextresultSet
- ResultSetexprIndex
- the position of the value in the resultpublic void setByte(org.datanucleus.ExecutionContext ec, PreparedStatement ps, int[] exprIndex, byte value)
JavaTypeMapping
value
into datastoreStatement
at position specified by exprIndex
.setByte
in class JavaTypeMapping
ec
- ExecutionContextps
- PreparedStatementexprIndex
- the position of the value in the statementvalue
- the valuepublic byte getByte(org.datanucleus.ExecutionContext ec, ResultSet resultSet, int[] exprIndex)
JavaTypeMapping
datastoreResults
at position specified by exprIndex
.getByte
in class JavaTypeMapping
ec
- ExecutionContextresultSet
- ResultSetexprIndex
- the position of the value in the resultpublic void setShort(org.datanucleus.ExecutionContext ec, PreparedStatement ps, int[] exprIndex, short value)
JavaTypeMapping
value
into datastoreStatement
at position specified by exprIndex
.setShort
in class JavaTypeMapping
ec
- execution contextps
- PreparedStatementexprIndex
- the position of the value in the statementvalue
- the valuepublic short getShort(org.datanucleus.ExecutionContext ec, ResultSet resultSet, int[] exprIndex)
JavaTypeMapping
datastoreResults
at position specified by exprIndex
.getShort
in class JavaTypeMapping
ec
- ExecutionContextresultSet
- ResultSetexprIndex
- the position of the value in the resultpublic void setInt(org.datanucleus.ExecutionContext ec, PreparedStatement ps, int[] exprIndex, int value)
JavaTypeMapping
value
into datastoreStatement
at position specified by exprIndex
.setInt
in class JavaTypeMapping
ec
- ExecutionContextps
- PreparedStatementexprIndex
- the position of the value in the statementvalue
- the valuepublic int getInt(org.datanucleus.ExecutionContext ec, ResultSet resultSet, int[] exprIndex)
JavaTypeMapping
datastoreResults
at position specified by exprIndex
.getInt
in class JavaTypeMapping
ec
- ExecutionContextresultSet
- ResultSetexprIndex
- the position of the value in the resultpublic void setLong(org.datanucleus.ExecutionContext ec, PreparedStatement ps, int[] exprIndex, long value)
JavaTypeMapping
value
into datastoreStatement
at position specified by exprIndex
.setLong
in class JavaTypeMapping
ec
- ExecutionContextps
- PreparedStatementexprIndex
- the position of the value in the statementvalue
- the valuepublic long getLong(org.datanucleus.ExecutionContext ec, ResultSet resultSet, int[] exprIndex)
JavaTypeMapping
datastoreResults
at position specified by exprIndex
.getLong
in class JavaTypeMapping
ec
- ExecutionContextresultSet
- ResultSetexprIndex
- the position of the value in the resultpublic void setFloat(org.datanucleus.ExecutionContext ec, PreparedStatement ps, int[] exprIndex, float value)
JavaTypeMapping
value
into datastoreStatement
at position specified by exprIndex
.setFloat
in class JavaTypeMapping
ec
- ExecutionContextps
- PreparedStatementexprIndex
- the position of the value in the statementvalue
- the valuepublic float getFloat(org.datanucleus.ExecutionContext ec, ResultSet resultSet, int[] exprIndex)
JavaTypeMapping
datastoreResults
at position specified by exprIndex
.getFloat
in class JavaTypeMapping
ec
- ExecutionContextresultSet
- ResultSetexprIndex
- the position of the value in the resultpublic void setDouble(org.datanucleus.ExecutionContext ec, PreparedStatement ps, int[] exprIndex, double value)
JavaTypeMapping
value
into datastoreStatement
at position specified by exprIndex
.setDouble
in class JavaTypeMapping
ec
- ExecutionContextps
- PreparedStatementexprIndex
- the position of the value in the statementvalue
- the valuepublic double getDouble(org.datanucleus.ExecutionContext ec, ResultSet resultSet, int[] exprIndex)
JavaTypeMapping
datastoreResults
at position specified by exprIndex
.getDouble
in class JavaTypeMapping
ec
- ExecutionContextresultSet
- ResultSetexprIndex
- the position of the value in the resultpublic void setString(org.datanucleus.ExecutionContext ec, PreparedStatement ps, int[] exprIndex, String value)
JavaTypeMapping
value
into datastoreStatement
at position specified by exprIndex
.setString
in class JavaTypeMapping
ec
- ExecutionContextps
- PreparedStatementexprIndex
- the position of the value in the statementvalue
- the valuepublic String getString(org.datanucleus.ExecutionContext ec, ResultSet resultSet, int[] exprIndex)
JavaTypeMapping
datastoreResults
at position specified by exprIndex
.getString
in class JavaTypeMapping
ec
- ExecutionContextresultSet
- ResultSetexprIndex
- the position of the value in the resultpublic void setObject(org.datanucleus.ExecutionContext ec, PreparedStatement ps, int[] exprIndex, Object value)
JavaTypeMapping
value
into datastoreStatement
at position specified by exprIndex
.setObject
in class JavaTypeMapping
ec
- ExecutionContextps
- PreparedStatementexprIndex
- the position of the value in the statementvalue
- the valuepublic Object getObject(org.datanucleus.ExecutionContext ec, ResultSet resultSet, int[] exprIndex)
JavaTypeMapping
datastoreResults
at position specified by exprIndex
.getObject
in class JavaTypeMapping
ec
- ExecutionContextresultSet
- ResultSetexprIndex
- the position of the value in the resultCopyright © 2017. All rights reserved.