Class SerializableType<T extends Serializable>

  extended by org.hibernate.type.AbstractStandardBasicType<T>
      extended by org.hibernate.type.AbstractSingleColumnStandardBasicType<T>
          extended by org.hibernate.type.SerializableType<T>
All Implemented Interfaces:
Serializable, BasicType, SingleColumnType<T>, StringRepresentableType<T>, Type, XmlRepresentableType<T>

public class SerializableType<T extends Serializable>
extends AbstractSingleColumnStandardBasicType<T>

A type that maps between a VARBINARY and Serializable classes.

Notice specifically the 2 forms:

The important distinction has to do with locating the appropriate ClassLoader to use during deserialization. In the fist form we are always using the ClassLoader of the JVM (Hibernate will always fallback to trying its classloader as well). The second form is better at targeting the needed ClassLoader actually needed.

Gavin King, Steve Ebersole
See Also:
Serialized Form

Field Summary
static SerializableType<Serializable> INSTANCE
Constructor Summary
SerializableType(Class<T> serializableClass)
Method Summary
 String getName()
          Returns the abbreviated name of the type.
Methods inherited from class org.hibernate.type.AbstractSingleColumnStandardBasicType
get, nullSafeGet, nullSafeSet, nullSafeSet, set, sqlType
Methods inherited from class org.hibernate.type.AbstractStandardBasicType
assemble, beforeAssemble, compare, deepCopy, deepCopy, disassemble, fromString, fromStringValue, fromXMLNode, fromXMLString, get, getColumnSpan, getHashCode, getHashCode, getHashCode, getJavaTypeDescriptor, getMutabilityPlan, getRegistrationKeys, getReplacement, getReturnedClass, getSemiResolvedType, getSqlTypeDescriptor, hydrate, isAnyType, isAssociationType, isCollectionType, isComponentType, isDirty, isDirty, isDirty, isEntityType, isEqual, isEqual, isEqual, isModified, isMutable, isSame, isSame, isXMLElement, nullSafeGet, nullSafeGet, nullSafeGet, nullSafeGet, nullSafeSet, nullSafeSet, registerUnderJavaType, replace, replace, resolve, semiResolve, set, setToXMLNode, sqlTypes, toColumnNullness, toLoggableString, toString, toXMLString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.hibernate.type.SingleColumnType
fromStringValue, get, nullSafeGet, set, toString
Methods inherited from interface org.hibernate.type.Type
assemble, beforeAssemble, compare, deepCopy, disassemble, fromXMLNode, getColumnSpan, getHashCode, getHashCode, getReturnedClass, getSemiResolvedType, hydrate, isAnyType, isAssociationType, isCollectionType, isComponentType, isDirty, isDirty, isEntityType, isEqual, isEqual, isModified, isMutable, isSame, isXMLElement, nullSafeGet, nullSafeGet, nullSafeSet, replace, replace, resolve, semiResolve, setToXMLNode, sqlTypes, toColumnNullness, toLoggableString

Field Detail


public static final SerializableType<Serializable> INSTANCE
Constructor Detail


public SerializableType(Class<T> serializableClass)
Method Detail


public String getName()
Description copied from interface: Type
Returns the abbreviated name of the type.

String the Hibernate type name

Copyright © 2001-2010 Red Hat, Inc. All Rights Reserved.