org.hibernate.type

Class CharBooleanType

Implemented Interfaces:
DiscriminatorType, IdentifierType, Serializable, LiteralType, Serializable, Type
Known Direct Subclasses:
TrueFalseType, YesNoType

public abstract class CharBooleanType
extends BooleanType

Superclass for types that map Java boolean to SQL CHAR(1).
Author:
Gavin King

Method Summary

Object
get(ResultSet rs, String name)
protected abstract String
getFalseString()
protected abstract String
getTrueString()
String
objectToSQLString(Object value, Dialect dialect)
String representation of the value, suitable for embedding in an SQL statement.
void
set(PreparedStatement st, Object value, int index)
int
sqlType()
Object
stringToObject(String xml)

Methods inherited from class org.hibernate.type.BooleanType

fromStringValue, get, getDefaultValue, getName, getPrimitiveClass, getReturnedClass, objectToSQLString, set, sqlType, stringToObject

Methods inherited from class org.hibernate.type.PrimitiveType

getDefaultValue, getPrimitiveClass, toString

Methods inherited from class org.hibernate.type.ImmutableType

deepCopy, isMutable, replace

Methods inherited from class org.hibernate.type.NullableType

fromStringValue, fromXMLNode, fromXMLString, get, getColumnSpan, isDirty, isEqual, isEqual, nullSafeGet, nullSafeGet, nullSafeGet, nullSafeGet, nullSafeSet, nullSafeSet, nullSafeSet, nullSafeToString, set, setToXMLNode, sqlType, sqlTypes, toColumnNullness, toLoggableString, toString, toXMLString

Methods inherited from class org.hibernate.type.AbstractType

assemble, beforeAssemble, compare, disassemble, getHashCode, getHashCode, getSemiResolvedType, hydrate, isAnyType, isAssociationType, isCollectionType, isComponentType, isDirty, isEntityType, isEqual, isEqual, isModified, isSame, isXMLElement, replace, replaceNode, resolve, semiResolve

Method Details

get

public Object get(ResultSet rs,
                  String name)
            throws SQLException
Overrides:
get in interface BooleanType

getFalseString

protected abstract String getFalseString()

getTrueString

protected abstract String getTrueString()

objectToSQLString

public String objectToSQLString(Object value,
                                Dialect dialect)
            throws Exception
String representation of the value, suitable for embedding in an SQL statement.
Specified by:
objectToSQLString in interface LiteralType
Overrides:
objectToSQLString in interface BooleanType
Parameters:
value -
dialect -
Returns:
String the value, as it appears in a SQL query

set

public void set(PreparedStatement st,
                Object value,
                int index)
            throws SQLException
Overrides:
set in interface BooleanType

sqlType

public int sqlType()
Overrides:
sqlType in interface BooleanType

stringToObject

public Object stringToObject(String xml)
            throws Exception
Specified by:
stringToObject in interface IdentifierType
Overrides:
stringToObject in interface BooleanType