org.jpox.store.rdbms.mapping
Class ColumnMapping

java.lang.Object
  extended byorg.jpox.store.rdbms.mapping.RDBMSMapping
      extended byorg.jpox.store.rdbms.mapping.ColumnMapping
All Implemented Interfaces:
DatastoreMapping
Direct Known Subclasses:
AbstractLargeBinaryRDBMSMapping, BigIntRDBMSMapping, BooleanRDBMSMapping, CharRDBMSMapping, DateRDBMSMapping, DecimalRDBMSMapping, DoubleRDBMSMapping, IntegerRDBMSMapping, LongVarcharRDBMSMapping, NumericRDBMSMapping, OracleBlobRDBMSMapping, RealRDBMSMapping, SmallIntRDBMSMapping, TimeRDBMSMapping, TimestampRDBMSMapping, TinyIntRDBMSMapping

public abstract class ColumnMapping
extends RDBMSMapping

Column Mapping.

Version:
$Revision: 1.9 $

Field Summary
protected  Column column
           
 
Fields inherited from class org.jpox.store.rdbms.mapping.RDBMSMapping
LOCALISER, LOCALISER_STORE, mapping, storeMgr
 
Constructor Summary
ColumnMapping(StoreManager storeMgr, JavaTypeMapping mapping)
          Create a new Mapping.
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 Column getColumn()
           
 DatastoreField getDatastoreField()
          The datastore field mapped
 java.lang.String getInsertionInputParameter()
          Accessor for the string to put in any retrieval datastore statement for this field.
abstract  TypeInfo getTypeInfo()
          Returns the TypeInfo (JDBC SQL type) for columns.
 java.lang.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 isNullable()
          Accessor for whether the mapping is nullable.
 
Methods inherited from class org.jpox.store.rdbms.mapping.RDBMSMapping
failureMessage, getBoolean, getByte, getChar, getDatabaseAdapter, getDouble, getFloat, getInt, getJavaTypeMapping, getLong, getObject, getShort, getString, setBoolean, setByte, setChar, setDouble, setFloat, setInt, setLong, setObject, setShort, setString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

column

protected Column column
Constructor Detail

ColumnMapping

public ColumnMapping(StoreManager storeMgr,
                     JavaTypeMapping mapping)
Create a new Mapping.

Parameters:
storeMgr - The Store Manager that this Mapping should use.
mapping - The Class that this mapping maps to the database.
Method Detail

isNullable

public boolean isNullable()
Description copied from class: RDBMSMapping
Accessor for whether the mapping is nullable.

Specified by:
isNullable in interface DatastoreMapping
Specified by:
isNullable in class RDBMSMapping
Returns:
Whether it is nullable

getDatastoreField

public DatastoreField getDatastoreField()
Description copied from interface: DatastoreMapping
The datastore field mapped

Returns:
the DatastoreField

getTypeInfo

public abstract TypeInfo getTypeInfo()
Returns the TypeInfo (JDBC SQL type) for columns. This method is capable of returning only one TypeInfo (SQL Type). In that way, it seems adequate for using in 1 column Mapping or many columns that share the same TypeInfo. However adequate in most of uses, Mappings using two or more columns should overwrite the initTypeInfo method to appropriate set differents TypeInfo (SQL type) for all the columns

Specified by:
getTypeInfo in class RDBMSMapping
Returns:
The TypeInfo

initTypeInfo

protected void initTypeInfo()
Sets the TypeInfo for the columns of the Mapping. Mappings using two or more columns using different TypeInfo(s) should overwrite this method to appropriate set the TypeInfo (SQL type) for all the columns


getColumn

public Column getColumn()
Returns:
Returns the column.

includeInFetchStatement

public boolean includeInFetchStatement()
Description copied from class: RDBMSMapping
Whether this mapping is included in the fetch statement.

Specified by:
includeInFetchStatement in class RDBMSMapping
Returns:
Whether to include in fetch statement

getInsertionInputParameter

public java.lang.String getInsertionInputParameter()
Description copied from class: RDBMSMapping
Accessor for the string to put in any retrieval datastore statement for this field. In RDBMS, this is typically a ? to be used in JDBC statements.

Specified by:
getInsertionInputParameter in class RDBMSMapping
Returns:
The input parameter

getUpdateInputParameter

public java.lang.String getUpdateInputParameter()
Description copied from class: RDBMSMapping
Accessor for the string to put in any update datastore statements for this field. In RDBMS, this is typically a ? to be used in JDBC statements.

Specified by:
getUpdateInputParameter in class RDBMSMapping
Returns:
The input parameter.

equals

public boolean equals(java.lang.Object obj)

hashCode

public int hashCode()


Copyright © -2007 . All Rights Reserved.