org.datanucleus.store.rdbms.mapping
Class CharRDBMSMapping

java.lang.Object
  extended by org.datanucleus.store.rdbms.mapping.RDBMSMapping
      extended by org.datanucleus.store.rdbms.mapping.CharRDBMSMapping
All Implemented Interfaces:
org.datanucleus.store.mapped.mapping.DatastoreMapping
Direct Known Subclasses:
DatalinkRDBMSMapping, VarCharRDBMSMapping

public class CharRDBMSMapping
extends RDBMSMapping

Mapping of a CHAR RDBMS type.


Field Summary
 
Fields inherited from class org.datanucleus.store.rdbms.mapping.RDBMSMapping
column, LOCALISER, LOCALISER_STORE, mapping, storeMgr
 
Constructor Summary
  CharRDBMSMapping(org.datanucleus.store.mapped.mapping.JavaTypeMapping mapping, org.datanucleus.store.mapped.MappedStoreManager storeMgr, org.datanucleus.store.mapped.DatastoreField field)
          Constructor.
protected CharRDBMSMapping(org.datanucleus.store.mapped.MappedStoreManager storeMgr, org.datanucleus.store.mapped.mapping.JavaTypeMapping mapping)
          Constructor.
 
Method Summary
 boolean getBoolean(java.lang.Object rs, int param)
          Method to extract a boolean from the ResultSet at the specified position
 char getChar(java.lang.Object rs, int param)
          Method to extract a character from the ResultSet at the specified position
 java.text.SimpleDateFormat getJavaUtilDateFormat()
          Get a Format object to handle dates.
 java.lang.Object getObject(java.lang.Object rs, int param)
          Method to extract an object from the ResultSet at the specified position
 java.lang.String getString(java.lang.Object rs, int param)
          Method to extract a String from the ResultSet at the specified position
 SQLTypeInfo getTypeInfo()
          Accessor for the (SQL) type info for this datastore type.
protected  void initialize()
          Method to initialise the column mapping.
 boolean isStringBased()
          Accessor for whether the mapping is string-based.
 void setBoolean(java.lang.Object ps, int param, boolean value)
          Method to set a boolean at the specified position in the JDBC PreparedStatement.
 void setChar(java.lang.Object ps, int param, char value)
          Method to set a character at the specified position in the JDBC PreparedStatement.
 void setObject(java.lang.Object ps, int param, java.lang.Object value)
          Method to set an object at the specified position in the JDBC PreparedStatement.
 void setString(java.lang.Object ps, int param, java.lang.String value)
          Method to set a String at the specified position in the JDBC PreparedStatement.
 
Methods inherited from class org.datanucleus.store.rdbms.mapping.RDBMSMapping
equals, failureMessage, getByte, getColumn, getDatabaseAdapter, getDatastoreField, getDouble, getFloat, getInsertionInputParameter, getInt, getJavaTypeMapping, getLong, getShort, getUpdateInputParameter, hashCode, includeInFetchStatement, initTypeInfo, insertValuesOnInsert, isBitBased, isBooleanBased, isDecimalBased, isIntegerBased, isNullable, setByte, setDouble, setFloat, setInt, setLong, setShort
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CharRDBMSMapping

protected CharRDBMSMapping(org.datanucleus.store.mapped.MappedStoreManager storeMgr,
                           org.datanucleus.store.mapped.mapping.JavaTypeMapping mapping)
Constructor.

Parameters:
storeMgr - Store Manager
mapping - Java type mapping

CharRDBMSMapping

public CharRDBMSMapping(org.datanucleus.store.mapped.mapping.JavaTypeMapping mapping,
                        org.datanucleus.store.mapped.MappedStoreManager storeMgr,
                        org.datanucleus.store.mapped.DatastoreField field)
Constructor.

Parameters:
mapping - Java type mapping
storeMgr - Store Manager
field - Field to be mapped
Method Detail

initialize

protected void initialize()
Method to initialise the column mapping. Provides default length specifications for the CHAR column to fit the data being stored.


isStringBased

public boolean isStringBased()
Accessor for whether the mapping is string-based.

Specified by:
isStringBased in interface org.datanucleus.store.mapped.mapping.DatastoreMapping
Overrides:
isStringBased in class RDBMSMapping
Returns:
Whether the mapping is string based

getTypeInfo

public SQLTypeInfo getTypeInfo()
Description copied from class: RDBMSMapping
Accessor for the (SQL) type info for this datastore type.

Specified by:
getTypeInfo in class RDBMSMapping
Returns:
The type info

setChar

public void setChar(java.lang.Object ps,
                    int param,
                    char value)
Method to set a character at the specified position in the JDBC PreparedStatement.

Specified by:
setChar in interface org.datanucleus.store.mapped.mapping.DatastoreMapping
Overrides:
setChar in class RDBMSMapping
Parameters:
ps - The PreparedStatement
param - Parameter position
value - The value to set

getChar

public char getChar(java.lang.Object rs,
                    int param)
Method to extract a character from the ResultSet at the specified position

Specified by:
getChar in interface org.datanucleus.store.mapped.mapping.DatastoreMapping
Overrides:
getChar in class RDBMSMapping
Parameters:
rs - The Result Set
param - The parameter position
Returns:
the character

setString

public void setString(java.lang.Object ps,
                      int param,
                      java.lang.String value)
Method to set a String at the specified position in the JDBC PreparedStatement.

Specified by:
setString in interface org.datanucleus.store.mapped.mapping.DatastoreMapping
Overrides:
setString in class RDBMSMapping
Parameters:
ps - The PreparedStatement
param - Parameter position
value - The value to set

getString

public java.lang.String getString(java.lang.Object rs,
                                  int param)
Method to extract a String from the ResultSet at the specified position

Specified by:
getString in interface org.datanucleus.store.mapped.mapping.DatastoreMapping
Overrides:
getString in class RDBMSMapping
Parameters:
rs - The Result Set
param - The parameter position
Returns:
the String

setBoolean

public void setBoolean(java.lang.Object ps,
                       int param,
                       boolean value)
Method to set a boolean at the specified position in the JDBC PreparedStatement.

Specified by:
setBoolean in interface org.datanucleus.store.mapped.mapping.DatastoreMapping
Overrides:
setBoolean in class RDBMSMapping
Parameters:
ps - The PreparedStatement
param - Parameter position
value - The value to set

getBoolean

public boolean getBoolean(java.lang.Object rs,
                          int param)
Method to extract a boolean from the ResultSet at the specified position

Specified by:
getBoolean in interface org.datanucleus.store.mapped.mapping.DatastoreMapping
Overrides:
getBoolean in class RDBMSMapping
Parameters:
rs - The Result Set
param - The parameter position
Returns:
the boolean

setObject

public void setObject(java.lang.Object ps,
                      int param,
                      java.lang.Object value)
Method to set an object at the specified position in the JDBC PreparedStatement.

Specified by:
setObject in interface org.datanucleus.store.mapped.mapping.DatastoreMapping
Overrides:
setObject in class RDBMSMapping
Parameters:
ps - The PreparedStatement
param - Parameter position
value - The value to set

getObject

public java.lang.Object getObject(java.lang.Object rs,
                                  int param)
Method to extract an object from the ResultSet at the specified position

Specified by:
getObject in interface org.datanucleus.store.mapped.mapping.DatastoreMapping
Overrides:
getObject in class RDBMSMapping
Parameters:
rs - The Result Set
param - The parameter position
Returns:
the object

getJavaUtilDateFormat

public java.text.SimpleDateFormat getJavaUtilDateFormat()
Get a Format object to handle dates. If a TimeZone is present, it will be used to format dates to that zone.

Returns:
The date format to use


Copyright © 2009. All Rights Reserved.