public abstract class

NullableType

extends AbstractType
implements StringRepresentableType<T> XmlRepresentableType<T>
java.lang.Object
   ↳ org.hibernate.type.AbstractType
     ↳ org.hibernate.type.NullableType
Known Direct Subclasses
Known Indirect Subclasses

This class is deprecated.
Use the AbstractStandardBasicType approach instead

Class Overview

Superclass of single-column nullable types.

Summary

Public Constructors
NullableType()
Public Methods
abstract Object fromStringValue(String xml)
Consume the given string representation back into this types java form.
Object fromXMLNode(Node xml, Mapping factory)
final Object fromXMLString(String xml, Mapping factory)
abstract Object get(ResultSet rs, String name)
Get a column value from a result set, without worrying about the possibility of null values.
final int getColumnSpan(Mapping session)
boolean isDirty(Object old, Object current, boolean[] checkable, SessionImplementor session)
final boolean isEqual(Object x, Object y, EntityMode entityMode)
Compare two instances of the class mapped by this type for persistence "equality" (equality of persistent state).
boolean isEqual(Object x, Object y)
final Object nullSafeGet(ResultSet rs, String name, SessionImplementor session, Object owner)
final Object nullSafeGet(ResultSet rs, String[] names)
final Object nullSafeGet(ResultSet rs, String[] names, SessionImplementor session, Object owner)
final Object nullSafeGet(ResultSet rs, String name)
final void nullSafeSet(PreparedStatement st, Object value, int index)
final void nullSafeSet(PreparedStatement st, Object value, int index, boolean[] settable, SessionImplementor session)
final void nullSafeSet(PreparedStatement st, Object value, int index, SessionImplementor session)
String nullSafeToString(Object value)
A null-safe version of toString(Object).
abstract void set(PreparedStatement st, Object value, int index)
Set a parameter value without worrying about the possibility of null values.
void setToXMLNode(Node xml, Object value, SessionFactoryImplementor factory)
abstract int sqlType()
A convenience form of sqlTypes(org.hibernate.engine.Mapping), returning just a single type value since these are explicitly dealing with single column mappings.
final int[] sqlTypes(Mapping session)
boolean[] toColumnNullness(Object value, Mapping mapping)
String toLoggableString(Object value, SessionFactoryImplementor factory)
abstract String toString(Object value)
final String toXMLString(Object value, SessionFactoryImplementor pc)
[Expand]
Inherited Methods
From class org.hibernate.type.AbstractType
From class java.lang.Object
From interface org.hibernate.type.StringRepresentableType
From interface org.hibernate.type.Type
From interface org.hibernate.type.XmlRepresentableType

Public Constructors

public NullableType ()

Public Methods

public abstract Object fromStringValue (String xml)

Consume the given string representation back into this types java form.

Parameters
xml The string representation to be consumed.
Returns
  • The java type representation

public Object fromXMLNode (Node xml, Mapping factory)

public final Object fromXMLString (String xml, Mapping factory)

public abstract Object get (ResultSet rs, String name)

Get a column value from a result set, without worrying about the possibility of null values. Called from nullSafeGet(ResultSet, String) after nullness checks have been performed.

Parameters
rs The result set from which to extract the value.
name The name of the value to extract.
Returns
  • The extracted value.
Throws
HibernateException Generally some form of mismatch error.
SQLException Indicates problem making the JDBC call(s).

public final int getColumnSpan (Mapping session)

public boolean isDirty (Object old, Object current, boolean[] checkable, SessionImplementor session)

public final boolean isEqual (Object x, Object y, EntityMode entityMode)

Compare two instances of the class mapped by this type for persistence "equality" (equality of persistent state).

This should always equate to some form of comparison of the value's internal state. As an example, for something like a date the comparison should be based on its internal "time" state based on the specific portion it is meant to represent (timestamp, date, time).

Parameters
x The first value
y The second value
entityMode The entity mode of the values.
Returns
  • True if there are considered equal (see discussion above).

public boolean isEqual (Object x, Object y)

public final Object nullSafeGet (ResultSet rs, String name, SessionImplementor session, Object owner)

public final Object nullSafeGet (ResultSet rs, String[] names)

public final Object nullSafeGet (ResultSet rs, String[] names, SessionImplementor session, Object owner)

public final Object nullSafeGet (ResultSet rs, String name)

public final void nullSafeSet (PreparedStatement st, Object value, int index)

public final void nullSafeSet (PreparedStatement st, Object value, int index, boolean[] settable, SessionImplementor session)

public final void nullSafeSet (PreparedStatement st, Object value, int index, SessionImplementor session)

public String nullSafeToString (Object value)

A null-safe version of toString(Object). Specifically we are worried about null safeness in regards to the incoming value parameter, not the return.

Parameters
value The value to convert to a string representation; may be null.
Returns
  • The string representation; may be null.
Throws
HibernateException Thrown by toString(Object), which this calls.

public abstract void set (PreparedStatement st, Object value, int index)

Set a parameter value without worrying about the possibility of null values. Called from nullSafeSet(PreparedStatement, Object, int) after nullness checks have been performed.

Parameters
st The statement into which to bind the parameter value.
value The parameter value to bind.
index The position or index at which to bind the param value.
Throws
HibernateException Generally some form of mismatch error.
SQLException Indicates problem making the JDBC call(s).

public void setToXMLNode (Node xml, Object value, SessionFactoryImplementor factory)

public abstract int sqlType ()

A convenience form of sqlTypes(org.hibernate.engine.Mapping), returning just a single type value since these are explicitly dealing with single column mappings.

Returns
  • The java.sql.Types mapping value.

public final int[] sqlTypes (Mapping session)

public boolean[] toColumnNullness (Object value, Mapping mapping)

public String toLoggableString (Object value, SessionFactoryImplementor factory)

public abstract String toString (Object value)

public final String toXMLString (Object value, SessionFactoryImplementor pc)