org.hibernate.type

Class NumericBooleanType

Implemented Interfaces:
DiscriminatorType, IdentifierType, Serializable, LiteralType, Serializable, Type

public class NumericBooleanType
extends BooleanType

Maps interger database values to boolean java values. Zero is considered false; NULL maps to getDefaultValue(); any other value is considered true.
Author:
Steve Ebersole
See Also:
getName()

Method Summary

Object
get(ResultSet rs, String name)
String
getName()
This type's name is numeric_boolean
String
objectToSQLString(Object value, Dialect dialect)
void
set(PreparedStatement st, Object value, int index)
int
sqlType()

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

getName

public String getName()
This type's name is numeric_boolean
Specified by:
getName in interface Type
Overrides:
getName in interface BooleanType

objectToSQLString

public String objectToSQLString(Object value,
                                Dialect dialect)
            throws Exception
Specified by:
objectToSQLString in interface LiteralType
Overrides:
objectToSQLString in interface BooleanType

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