jacquard 1.12.0 by The Web Engineering Factory and Toolworks

uk.co.weft.dbutil
Class BitColumnDescriptor

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

public class BitColumnDescriptor
extends ColumnDescriptor

A descriptor for an bit column

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

Constructor Summary
BitColumnDescriptor(java.lang.String n)
          Creates a new BitColumnDescriptor object.
 
Method Summary
protected  java.lang.String format(Context c)
          Format a bit for sending to the database.
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, genKey, quoteValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BitColumnDescriptor

public BitColumnDescriptor(java.lang.String n)
Creates a new BitColumnDescriptor object.

Parameters:
n - DOCUMENT ME!
Method Detail

format

protected java.lang.String format(Context c)
                           throws DataFormatException
Format a bit for sending to the database.

Overrides:
format in class ColumnDescriptor
Parameters:
c - the in which to find my vallue
Returns:
the string "1" if my value can be coerced to Boolean.TRUE, "0" otherwise.
Throws:
DataFormatException
See Also:
for rules about how we coerce a value to a Boolean

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. This method used to use Boolean.valueOf() until I discovered that Boolean.valueOf( "t") -> false!

Overrides:
interpret in class ColumnDescriptor
Throws:
DataFormatException

jacquard 1.12.0 by The Web Engineering Factory and Toolworks