public class TypeConverterMapping extends SingleFieldMapping
absFieldNumber, datastoreMappings, mmd, referenceMapping, roleForMember, storeMgr, table, type| Constructor and Description |
|---|
TypeConverterMapping() |
| 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. |
Class |
getJavaType()
Accessor for the java type being mapped.
|
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. |
protected Object |
getMemberValueFromDatastore(ResultSet resultSet,
int[] exprIndex)
Method that retrieves the datastore value and converts it back to the member value.
|
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. |
org.datanucleus.store.types.converters.TypeConverter |
getTypeConverter() |
void |
initialize(org.datanucleus.metadata.AbstractMemberMetaData mmd,
Table table,
org.datanucleus.ClassLoaderResolver clr)
Initialize this JavaTypeMapping with the given DatastoreAdapter for the given FieldMetaData.
|
void |
initialize(org.datanucleus.metadata.AbstractMemberMetaData mmd,
Table table,
org.datanucleus.ClassLoaderResolver clr,
org.datanucleus.store.types.converters.TypeConverter conv) |
void |
initialize(RDBMSStoreManager storeMgr,
String type)
Initialise this JavaTypeMapping with the given StoreManager for the given type.
|
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. |
protected void |
setDatastoreFromMemberValue(PreparedStatement ps,
int[] exprIndex,
Object memberValue)
Method that takes the member value and sets the datastore value in the PreparedStatement at the specified position.
|
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. |
getValidValues, prepareDatastoreMappingaddDatastoreMapping, equals, failureMessage, getAbsoluteFieldNumber, getColumnMetaDataForMember, getDatastoreMapping, getDatastoreMappings, getMemberMetaData, getNumberOfDatastoreMappings, getObject, getReferenceMapping, getRoleForMember, getStoreManager, getTable, getType, getValueForDatastoreMapping, hashCode, hasSimpleDatastoreRepresentation, includeInFetchStatement, includeInInsertStatement, includeInUpdateStatement, isNullable, isSerialised, representableAsStringLiteralInStatement, setAbsFieldNumber, setMemberMetaData, setObject, setReferenceMapping, setRoleForMember, setTablepublic void initialize(RDBMSStoreManager storeMgr, String type)
JavaTypeMappinginitialize in class JavaTypeMappingstoreMgr - The Datastore Adapter that this Mapping should use.type - The Class that this mapping maps to the database.public void initialize(org.datanucleus.metadata.AbstractMemberMetaData mmd,
Table table,
org.datanucleus.ClassLoaderResolver clr)
SingleFieldMappinginitialize in class SingleFieldMappingmmd - FieldMetaData for the field to be mapped (if any)table - The datastore container storing this mapping (if any)clr - the ClassLoaderResolverpublic void initialize(org.datanucleus.metadata.AbstractMemberMetaData mmd,
Table table,
org.datanucleus.ClassLoaderResolver clr,
org.datanucleus.store.types.converters.TypeConverter conv)
public org.datanucleus.store.types.converters.TypeConverter getTypeConverter()
public int getDefaultLength(int index)
SingleFieldMappinggetDefaultLength in class SingleFieldMappingindex - requested datastore field index.public String getJavaTypeForDatastoreMapping(int index)
getJavaTypeForDatastoreMapping in class SingleFieldMappingindex - requested datastore field index.public Class getJavaType()
JavaTypeMappinggetJavaType in class JavaTypeMappingprotected void setDatastoreFromMemberValue(PreparedStatement ps, int[] exprIndex, Object memberValue)
ps - The PreparedStatementexprIndex - The position in the statementmemberValue - The member value for this fieldprotected Object getMemberValueFromDatastore(ResultSet resultSet, int[] exprIndex)
resultSet - The result setexprIndex - The position in the result setpublic void setBoolean(org.datanucleus.ExecutionContext ec,
PreparedStatement ps,
int[] exprIndex,
boolean value)
JavaTypeMappingvalue into datastoreStatement
at position specified by exprIndex.setBoolean in class SingleFieldMappingec - ExecutionContextps - PreparedStatementexprIndex - the position of the value in the statementvalue - the valuepublic boolean getBoolean(org.datanucleus.ExecutionContext ec,
ResultSet resultSet,
int[] exprIndex)
JavaTypeMappingdatastoreResults
at position specified by exprIndex.getBoolean in class SingleFieldMappingec - ExecutionContextresultSet - ResultSetexprIndex - the position of the value in the resultpublic void setByte(org.datanucleus.ExecutionContext ec,
PreparedStatement ps,
int[] exprIndex,
byte value)
JavaTypeMappingvalue into datastoreStatement
at position specified by exprIndex.setByte in class SingleFieldMappingec - ExecutionContextps - PreparedStatementexprIndex - the position of the value in the statementvalue - the valuepublic byte getByte(org.datanucleus.ExecutionContext ec,
ResultSet resultSet,
int[] exprIndex)
JavaTypeMappingdatastoreResults
at position specified by exprIndex.getByte in class SingleFieldMappingec - ExecutionContextresultSet - ResultSetexprIndex - the position of the value in the resultpublic void setChar(org.datanucleus.ExecutionContext ec,
PreparedStatement ps,
int[] exprIndex,
char value)
JavaTypeMappingvalue into datastoreStatement
at position specified by exprIndex.setChar in class SingleFieldMappingec - ExecutionContextps - PreparedStatementexprIndex - the position of the value in the statementvalue - the valuepublic char getChar(org.datanucleus.ExecutionContext ec,
ResultSet resultSet,
int[] exprIndex)
JavaTypeMappingdatastoreResults
at position specified by exprIndex.getChar in class SingleFieldMappingec - ExecutionContextresultSet - ResultSetexprIndex - the position of the value in the resultpublic void setDouble(org.datanucleus.ExecutionContext ec,
PreparedStatement ps,
int[] exprIndex,
double value)
JavaTypeMappingvalue into datastoreStatement
at position specified by exprIndex.setDouble in class SingleFieldMappingec - ExecutionContextps - PreparedStatementexprIndex - the position of the value in the statementvalue - the valuepublic double getDouble(org.datanucleus.ExecutionContext ec,
ResultSet resultSet,
int[] exprIndex)
JavaTypeMappingdatastoreResults
at position specified by exprIndex.getDouble in class SingleFieldMappingec - ExecutionContextresultSet - ResultSetexprIndex - the position of the value in the resultpublic void setFloat(org.datanucleus.ExecutionContext ec,
PreparedStatement ps,
int[] exprIndex,
float value)
JavaTypeMappingvalue into datastoreStatement
at position specified by exprIndex.setFloat in class SingleFieldMappingec - ExecutionContextps - PreparedStatementexprIndex - the position of the value in the statementvalue - the valuepublic float getFloat(org.datanucleus.ExecutionContext ec,
ResultSet resultSet,
int[] exprIndex)
JavaTypeMappingdatastoreResults
at position specified by exprIndex.getFloat in class SingleFieldMappingec - ExecutionContextresultSet - ResultSetexprIndex - the position of the value in the resultpublic void setInt(org.datanucleus.ExecutionContext ec,
PreparedStatement ps,
int[] exprIndex,
int value)
JavaTypeMappingvalue into datastoreStatement
at position specified by exprIndex.setInt in class SingleFieldMappingec - ExecutionContextps - PreparedStatementexprIndex - the position of the value in the statementvalue - the valuepublic int getInt(org.datanucleus.ExecutionContext ec,
ResultSet resultSet,
int[] exprIndex)
JavaTypeMappingdatastoreResults
at position specified by exprIndex.getInt in class SingleFieldMappingec - ExecutionContextresultSet - ResultSetexprIndex - the position of the value in the resultpublic void setLong(org.datanucleus.ExecutionContext ec,
PreparedStatement ps,
int[] exprIndex,
long value)
JavaTypeMappingvalue into datastoreStatement
at position specified by exprIndex.setLong in class SingleFieldMappingec - ExecutionContextps - PreparedStatementexprIndex - the position of the value in the statementvalue - the valuepublic long getLong(org.datanucleus.ExecutionContext ec,
ResultSet resultSet,
int[] exprIndex)
JavaTypeMappingdatastoreResults
at position specified by exprIndex.getLong in class SingleFieldMappingec - ExecutionContextresultSet - ResultSetexprIndex - the position of the value in the resultpublic void setShort(org.datanucleus.ExecutionContext ec,
PreparedStatement ps,
int[] exprIndex,
short value)
JavaTypeMappingvalue into datastoreStatement
at position specified by exprIndex.setShort in class SingleFieldMappingec - execution contextps - PreparedStatementexprIndex - the position of the value in the statementvalue - the valuepublic short getShort(org.datanucleus.ExecutionContext ec,
ResultSet resultSet,
int[] exprIndex)
JavaTypeMappingdatastoreResults
at position specified by exprIndex.getShort in class SingleFieldMappingec - ExecutionContextresultSet - ResultSetexprIndex - the position of the value in the resultpublic void setString(org.datanucleus.ExecutionContext ec,
PreparedStatement ps,
int[] exprIndex,
String value)
JavaTypeMappingvalue into datastoreStatement
at position specified by exprIndex.setString in class SingleFieldMappingec - ExecutionContextps - PreparedStatementexprIndex - the position of the value in the statementvalue - the valuepublic String getString(org.datanucleus.ExecutionContext ec, ResultSet resultSet, int[] exprIndex)
JavaTypeMappingdatastoreResults
at position specified by exprIndex.getString in class SingleFieldMappingec - ExecutionContextresultSet - ResultSetexprIndex - the position of the value in the resultpublic void setObject(org.datanucleus.ExecutionContext ec,
PreparedStatement ps,
int[] exprIndex,
Object value)
JavaTypeMappingvalue into datastoreStatement
at position specified by exprIndex.setObject in class SingleFieldMappingec - ExecutionContextps - PreparedStatementexprIndex - the position of the value in the statementvalue - the valuepublic Object getObject(org.datanucleus.ExecutionContext ec, ResultSet resultSet, int[] exprIndex)
JavaTypeMappingdatastoreResults
at position specified by exprIndex.getObject in class SingleFieldMappingec - ExecutionContextresultSet - ResultSetexprIndex - the position of the value in the resultCopyright © 2017. All rights reserved.