jacquard 1.12.0 by The Web Engineering Factory and Toolworks

uk.co.weft.dbutil
Class BooleanColumnDescriptor

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

public class BooleanColumnDescriptor
extends ColumnDescriptor

A descriptor for an boolean column

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

Constructor Summary
BooleanColumnDescriptor(java.lang.String n)
          Creates a new BooleanColumnDescriptor object.
 
Method Summary
protected  java.lang.String format(Context c)
          Format a boolean 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

BooleanColumnDescriptor

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

Parameters:
n - my name
Method Detail

format

protected java.lang.String format(Context c)
                           throws DataFormatException
Format a boolean for sending to the database. The ANSI SQL definition appears (to me) to be very unclear about how a boolean should be represented, but 'true' and 'false' seem to work so far.

Overrides:
format in class ColumnDescriptor
Throws:
DataFormatException

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