Class SerializableType<T extends Serializable>

All Implemented Interfaces:
BasicType<T>, Type<T>, Serializable, BasicValuedMapping, Bindable, JdbcMapping, JdbcMappingContainer, MappingModelExpressible, MappingType, SqlExpressible, ValueMapping, BasicDomainType<T>, DomainType<T>, SimpleDomainType<T>, BindableType<T>, OutputableType<T>, ReturnableType<T>, SqmExpressible<T>, BasicType<T>, JavaTypedExpressible, ProcedureParameterExtractionAware<T>, ProcedureParameterNamedBinder<T>, Type

public class SerializableType<T extends Serializable> extends AbstractSingleColumnStandardBasicType<T>
A type that maps between a VARBINARY and Serializable classes.

Notice specifically the 3 constructors:

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 and third forms are better at targeting the needed ClassLoader actually needed.

See Also:
  • Field Details

  • Constructor Details

    • SerializableType

      public SerializableType(Class<T> serializableClass)
    • SerializableType

      public SerializableType(JavaType<T> jtd)
  • Method Details

    • getName

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