org.hibernate.type

Class AbstractCharArrayType

Implemented Interfaces:
Serializable, Type
Known Direct Subclasses:
CharArrayType, CharacterArrayType

public abstract class AbstractCharArrayType
extends MutableType

Logic to bind stream of char into a VARCHAR
Author:
Emmanuel Bernard

Method Summary

protected Object
deepCopyNotNull(Object value)
Object
fromStringValue(String xml)
Object
get(ResultSet rs, String name)
abstract Class
getReturnedClass()
The class returned by nullSafeGet() methods.
String
objectToSQLString(Object value, Dialect dialect)
void
set(PreparedStatement st, Object value, int index)
int
sqlType()
Object
stringToObject(String xml)
protected abstract Object
toExternalFormat(char[] chars)
Convert the char[] into the expected object type
protected abstract char[]
toInternalFormat(Object chars)
Convert the object into the internal char[] representation
String
toString(Object value)

Methods inherited from class org.hibernate.type.MutableType

deepCopy, deepCopyNotNull, 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

deepCopyNotNull

protected Object deepCopyNotNull(Object value)
            throws HibernateException
Overrides:
deepCopyNotNull in interface MutableType

fromStringValue

public Object fromStringValue(String xml)
Overrides:
fromStringValue in interface NullableType

get

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

getReturnedClass

public abstract Class getReturnedClass()
The class returned by nullSafeGet() methods. This is used to establish the class of an array of this type.
Specified by:
getReturnedClass in interface Type
Returns:
Class

objectToSQLString

public String objectToSQLString(Object value,
                                Dialect dialect)
            throws Exception

set

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

sqlType

public int sqlType()
Overrides:
sqlType in interface NullableType

stringToObject

public Object stringToObject(String xml)
            throws Exception

toExternalFormat

protected abstract Object toExternalFormat(char[] chars)
Convert the char[] into the expected object type

toInternalFormat

protected abstract char[] toInternalFormat(Object chars)
Convert the object into the internal char[] representation

toString

public String toString(Object value)
Overrides:
toString in interface NullableType