public class TypeConverterMapping extends SingleFieldMapping
EXTENSION_CHECK_CONSTRAINT_VALUES
absFieldNumber, columnMappings, 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 |
getJavaTypeForColumnMapping(int index)
Accessor for the name of the java-type actually used when mapping the particular column.
|
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, prepareColumnMapping
addColumnMapping, equals, failureMessage, getAbsoluteFieldNumber, getColumnMapping, getColumnMappings, getColumnMetaDataForMember, getMemberMetaData, getNumberOfColumnMappings, getObject, getReferenceMapping, getRoleForMember, getStoreManager, getTable, getType, getValueForColumnMapping, hashCode, hasSimpleDatastoreRepresentation, includeInFetchStatement, includeInInsertStatement, includeInUpdateStatement, isNullable, isSerialised, representableAsStringLiteralInStatement, setAbsFieldNumber, setMemberMetaData, setObject, setReferenceMapping, setRoleForMember, setTable
public void initialize(RDBMSStoreManager storeMgr, String type)
JavaTypeMapping
initialize
in class JavaTypeMapping
storeMgr
- 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)
SingleFieldMapping
initialize
in class SingleFieldMapping
mmd
- 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)
SingleFieldMapping
getDefaultLength
in class SingleFieldMapping
index
- requested column index.public String getJavaTypeForColumnMapping(int index)
getJavaTypeForColumnMapping
in class SingleFieldMapping
index
- requested column index.public Class getJavaType()
JavaTypeMapping
getJavaType
in class JavaTypeMapping
protected 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)
JavaTypeMapping
value
into datastoreStatement
at position specified by exprIndex
.setBoolean
in class SingleFieldMapping
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 SingleFieldMapping
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 SingleFieldMapping
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 SingleFieldMapping
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 SingleFieldMapping
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 SingleFieldMapping
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 SingleFieldMapping
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 SingleFieldMapping
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 SingleFieldMapping
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 SingleFieldMapping
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 SingleFieldMapping
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 SingleFieldMapping
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 SingleFieldMapping
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 SingleFieldMapping
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 SingleFieldMapping
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 SingleFieldMapping
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 SingleFieldMapping
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 SingleFieldMapping
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 SingleFieldMapping
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 SingleFieldMapping
ec
- ExecutionContextresultSet
- ResultSetexprIndex
- the position of the value in the resultCopyright © 2020. All rights reserved.