jacquard 1.12.0 by The Web Engineering Factory and Toolworks

uk.co.weft.dbutil
Class IntegerColumnDescriptor

java.lang.Object
  extended byuk.co.weft.dbutil.ColumnDescriptor
      extended byuk.co.weft.dbutil.IntegerColumnDescriptor

public class IntegerColumnDescriptor
extends ColumnDescriptor

A descriptor for an integer column

Version:
$Revision: 1.13.4.1 $ This revision: $Author: simon $
Author:
Simon Brooke

Field Summary
protected  int fieldwidth
          field width of this column.
 
Constructor Summary
IntegerColumnDescriptor(java.lang.String n, int f)
          Creates a new IntegerColumnDescriptor object.
 
Method Summary
protected  java.lang.String format(Context c)
          format an integer for sending to the database.
protected  java.lang.Object genKey(Context context)
          generate a new unique key for me given this context.
protected  java.lang.Object interpret(Context context, java.sql.ResultSet results)
          put into this context an interpretation of the value of my name in these results.
 
Methods inherited from class uk.co.weft.dbutil.ColumnDescriptor
createColumnDescriptor, formatForInsert, formatForMatch, formatForMatch, formatForSelect, formatForUpdate, quoteValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fieldwidth

protected int fieldwidth
field width of this column.

Constructor Detail

IntegerColumnDescriptor

public IntegerColumnDescriptor(java.lang.String n,
                               int f)
Creates a new IntegerColumnDescriptor object.

Parameters:
n - my name
f - my fieldwidth
Method Detail

format

protected java.lang.String format(Context c)
                           throws DataFormatException
format an integer for sending to the database.

Overrides:
format in class ColumnDescriptor
Throws:
DataFormatException

genKey

protected java.lang.Object genKey(Context context)
                           throws DataStoreException
generate a new unique key for me given this context. This is intended to work transparently with columns which are auto-incremented and with columns that aren't.

Overrides:
genKey in class ColumnDescriptor
Parameters:
context - a context from which I can grab a connection
Throws:
throws - DataStoreException if a unique key could not be generated
DataStoreException

interpret

protected java.lang.Object interpret(Context context,
                                     java.sql.ResultSet results)
                              throws DataFormatException
put into this context an interpretation of the value of my name in these results. Return the interpretation.

Overrides:
interpret in class ColumnDescriptor
Throws:
DataFormatException

jacquard 1.12.0 by The Web Engineering Factory and Toolworks