public abstract class AbstractDatastoreMapping extends Object implements DatastoreMapping
| Modifier and Type | Field and Description |
|---|---|
protected Column |
column
The RDBMS Column being persisted to.
|
protected static org.datanucleus.util.Localiser |
LOCALISER |
protected static org.datanucleus.util.Localiser |
LOCALISER_RDBMS |
protected JavaTypeMapping |
mapping
Mapping of the Java type.
|
protected RDBMSStoreManager |
storeMgr
Store Manager to use for mapping.
|
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractDatastoreMapping(RDBMSStoreManager storeMgr,
JavaTypeMapping mapping)
Create a new Mapping with the given DatabaseAdapter for the given type.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
protected String |
failureMessage(String method)
Utility to output any error message.
|
protected String |
failureMessage(String method,
int position,
Exception e)
Utility to output any error message.
|
protected String |
failureMessage(String method,
Object value,
Exception e)
Utility to output any error message.
|
boolean |
getBoolean(ResultSet resultSet,
int exprIndex)
Obtains a value from
resultSet
at position specified by exprIndex. |
byte |
getByte(ResultSet resultSet,
int exprIndex)
Obtains a value from
resultSet
at position specified by exprIndex. |
char |
getChar(ResultSet resultSet,
int exprIndex)
Obtains a value from
resultSet
at position specified by exprIndex. |
Column |
getColumn()
Accessor for the column
|
protected DatastoreAdapter |
getDatastoreAdapter()
Convenience to access the datastore adapter.
|
double |
getDouble(ResultSet resultSet,
int exprIndex)
Obtains a value from
resultSet
at position specified by exprIndex. |
float |
getFloat(ResultSet resultSet,
int exprIndex)
Obtains a value from
resultSet
at position specified by exprIndex. |
String |
getInsertionInputParameter()
Accessor for the string to put in any retrieval datastore statement for this field.
|
int |
getInt(ResultSet resultSet,
int exprIndex)
Obtains a value from
resultSet
at position specified by exprIndex. |
JavaTypeMapping |
getJavaTypeMapping()
Accessor for the java type mapping
|
long |
getLong(ResultSet resultSet,
int exprIndex)
Obtains a value from
resultSet
at position specified by exprIndex. |
Object |
getObject(ResultSet resultSet,
int exprIndex)
Obtains a value from
resultSet
at position specified by exprIndex. |
short |
getShort(ResultSet resultSet,
int exprIndex)
Obtains a value from
resultSet
at position specified by exprIndex. |
String |
getString(ResultSet resultSet,
int exprIndex)
Obtains a value from
resultSet
at position specified by exprIndex. |
abstract SQLTypeInfo |
getTypeInfo()
Accessor for the (SQL) type info for this datastore type.
|
String |
getUpdateInputParameter()
Accessor for the string to put in any update datastore statements for this field.
|
int |
hashCode() |
boolean |
includeInFetchStatement()
Whether this mapping is included in the fetch statement.
|
protected void |
initTypeInfo()
Sets the TypeInfo for the columns of the Mapping.
|
boolean |
insertValuesOnInsert()
Accessor for whether this mapping requires values inserting on an INSERT.
|
boolean |
isBitBased()
Accessor for whether the mapping is bit-based.
|
boolean |
isBooleanBased()
Accessor for whether the mapping is boolean-based.
|
boolean |
isDecimalBased()
Accessor for whether the mapping is decimal-based.
|
boolean |
isIntegerBased()
Accessor for whether the mapping is integer-based.
|
boolean |
isNullable()
Accessor for whether the mapping is nullable.
|
boolean |
isStringBased()
Accessor for whether the mapping is string-based.
|
void |
setBoolean(PreparedStatement ps,
int exprIndex,
boolean value)
Sets a
value into ps
at position specified by paramIndex. |
void |
setByte(PreparedStatement ps,
int exprIndex,
byte value)
Sets a
value into ps
at position specified by paramIndex. |
void |
setChar(PreparedStatement ps,
int exprIndex,
char value)
Sets a
value into ps
at position specified by paramIndex. |
void |
setDouble(PreparedStatement ps,
int exprIndex,
double value)
Sets a
value into ps
at position specified by paramIndex. |
void |
setFloat(PreparedStatement ps,
int exprIndex,
float value)
Sets a
value into ps
at position specified by paramIndex. |
void |
setInt(PreparedStatement ps,
int exprIndex,
int value)
Sets a
value into ps
at position specified by paramIndex. |
void |
setLong(PreparedStatement ps,
int exprIndex,
long value)
Sets a
value into ps
at position specified by paramIndex. |
void |
setObject(PreparedStatement ps,
int exprIndex,
Object value)
Sets a
value into ps
at position specified by paramIndex. |
void |
setShort(PreparedStatement ps,
int exprIndex,
short value)
Sets a
value into ps
at position specified by paramIndex. |
void |
setString(PreparedStatement ps,
int exprIndex,
String value)
Sets a
value into ps
at position specified by paramIndex. |
protected static final org.datanucleus.util.Localiser LOCALISER_RDBMS
protected static final org.datanucleus.util.Localiser LOCALISER
protected final JavaTypeMapping mapping
protected final RDBMSStoreManager storeMgr
protected Column column
protected AbstractDatastoreMapping(RDBMSStoreManager storeMgr, JavaTypeMapping mapping)
storeMgr - The Store Manager that this Mapping should use.mapping - Mapping for the underlying java type. This can be null on an "unmapped column".public JavaTypeMapping getJavaTypeMapping()
getJavaTypeMapping in interface DatastoreMappingprotected DatastoreAdapter getDatastoreAdapter()
public abstract SQLTypeInfo getTypeInfo()
public boolean isNullable()
isNullable in interface DatastoreMappingpublic boolean includeInFetchStatement()
public boolean insertValuesOnInsert()
public String getInsertionInputParameter()
public String getUpdateInputParameter()
public Column getColumn()
getColumn in interface DatastoreMappingprotected void initTypeInfo()
protected String failureMessage(String method, int position, Exception e)
method - The method that failed.position - The position of the columne - The exceptionprotected String failureMessage(String method, Object value, Exception e)
method - The method that failed.value - Value at the positione - The exceptionpublic void setBoolean(PreparedStatement ps, int exprIndex, boolean value)
DatastoreMappingvalue into ps
at position specified by paramIndex.setBoolean in interface DatastoreMappingps - PreparedStatementexprIndex - the position of the value in the statementvalue - the valuepublic boolean getBoolean(ResultSet resultSet, int exprIndex)
DatastoreMappingresultSet
at position specified by exprIndex.getBoolean in interface DatastoreMappingresultSet - ResultSetexprIndex - the position of the value in the resultpublic void setChar(PreparedStatement ps, int exprIndex, char value)
DatastoreMappingvalue into ps
at position specified by paramIndex.setChar in interface DatastoreMappingps - PreparedStatementexprIndex - the position of the value in the statementvalue - the valuepublic char getChar(ResultSet resultSet, int exprIndex)
DatastoreMappingresultSet
at position specified by exprIndex.getChar in interface DatastoreMappingresultSet - ResultSetexprIndex - the position of the value in the resultpublic void setByte(PreparedStatement ps, int exprIndex, byte value)
DatastoreMappingvalue into ps
at position specified by paramIndex.setByte in interface DatastoreMappingps - PreparedStatementexprIndex - the position of the value in the statementvalue - the valuepublic byte getByte(ResultSet resultSet, int exprIndex)
DatastoreMappingresultSet
at position specified by exprIndex.getByte in interface DatastoreMappingresultSet - ResultSetexprIndex - the position of the value in the resultpublic void setShort(PreparedStatement ps, int exprIndex, short value)
DatastoreMappingvalue into ps
at position specified by paramIndex.setShort in interface DatastoreMappingps - PreparedStatementexprIndex - the position of the value in the statementvalue - the valuepublic short getShort(ResultSet resultSet, int exprIndex)
DatastoreMappingresultSet
at position specified by exprIndex.getShort in interface DatastoreMappingresultSet - ResultSetexprIndex - the position of the value in the resultpublic void setInt(PreparedStatement ps, int exprIndex, int value)
DatastoreMappingvalue into ps
at position specified by paramIndex.setInt in interface DatastoreMappingps - PreparedStatementexprIndex - the position of the value in the statementvalue - the valuepublic int getInt(ResultSet resultSet, int exprIndex)
DatastoreMappingresultSet
at position specified by exprIndex.getInt in interface DatastoreMappingresultSet - ResultSetexprIndex - the position of the value in the resultpublic void setLong(PreparedStatement ps, int exprIndex, long value)
DatastoreMappingvalue into ps
at position specified by paramIndex.setLong in interface DatastoreMappingps - PreparedStatementexprIndex - the position of the value in the statementvalue - the valuepublic long getLong(ResultSet resultSet, int exprIndex)
DatastoreMappingresultSet
at position specified by exprIndex.getLong in interface DatastoreMappingresultSet - ResultSetexprIndex - the position of the value in the resultpublic void setFloat(PreparedStatement ps, int exprIndex, float value)
DatastoreMappingvalue into ps
at position specified by paramIndex.setFloat in interface DatastoreMappingps - PreparedStatementexprIndex - the position of the value in the statementvalue - the valuepublic float getFloat(ResultSet resultSet, int exprIndex)
DatastoreMappingresultSet
at position specified by exprIndex.getFloat in interface DatastoreMappingresultSet - ResultSetexprIndex - the position of the value in the resultpublic void setDouble(PreparedStatement ps, int exprIndex, double value)
DatastoreMappingvalue into ps
at position specified by paramIndex.setDouble in interface DatastoreMappingps - PreparedStatementexprIndex - the position of the value in the statementvalue - the valuepublic double getDouble(ResultSet resultSet, int exprIndex)
DatastoreMappingresultSet
at position specified by exprIndex.getDouble in interface DatastoreMappingresultSet - ResultSetexprIndex - the position of the value in the resultpublic void setString(PreparedStatement ps, int exprIndex, String value)
DatastoreMappingvalue into ps
at position specified by paramIndex.setString in interface DatastoreMappingps - PreparedStatementexprIndex - the position of the value in the statementvalue - the valuepublic String getString(ResultSet resultSet, int exprIndex)
DatastoreMappingresultSet
at position specified by exprIndex.getString in interface DatastoreMappingresultSet - ResultSetexprIndex - the position of the value in the resultpublic void setObject(PreparedStatement ps, int exprIndex, Object value)
DatastoreMappingvalue into ps
at position specified by paramIndex.setObject in interface DatastoreMappingps - PreparedStatementexprIndex - the position of the value in the statementvalue - the valuepublic Object getObject(ResultSet resultSet, int exprIndex)
DatastoreMappingresultSet
at position specified by exprIndex.getObject in interface DatastoreMappingresultSet - ResultSetexprIndex - the position of the value in the resultpublic boolean isDecimalBased()
isDecimalBased in interface DatastoreMappingpublic boolean isIntegerBased()
isIntegerBased in interface DatastoreMappingpublic boolean isStringBased()
isStringBased in interface DatastoreMappingpublic boolean isBitBased()
isBitBased in interface DatastoreMappingpublic boolean isBooleanBased()
isBooleanBased in interface DatastoreMappingCopyright © 2013. All Rights Reserved.