public abstract class

AbstractBynaryType

extends MutableType
implements Comparator<T> VersionType<T>
java.lang.Object
   ↳ org.hibernate.type.AbstractType
     ↳ org.hibernate.type.NullableType
       ↳ org.hibernate.type.MutableType
         ↳ org.hibernate.type.AbstractBynaryType
Known Direct Subclasses

This class is deprecated.
Use the AbstractStandardBasicType approach instead

Class Overview

Logic to bind stream of byte into a VARBINARY

Summary

Public Constructors
AbstractBynaryType()
Public Methods
int compare(Object o1, Object o2)
int compare(Object x, Object y, EntityMode entityMode)
Perform a Comparator style comparison between values
Object deepCopyNotNull(Object value)
Object fromStringValue(String xml)
Consume the given string representation back into this types java form.
Object get(ResultSet rs, String name)
Get a column value from a result set, without worrying about the possibility of null values.
Comparator getComparator()
Get a comparator for version values.
int getHashCode(Object x, EntityMode entityMode)
Get a hash code, consistent with persistence "equality".
abstract String getName()
Returns the abbreviated name of the type.
boolean isEqual(Object x, Object y)
Object next(Object current, SessionImplementor session)
Object seed(SessionImplementor session)
Generate an initial version.
void set(PreparedStatement st, Object value, int index)
Set a parameter value without worrying about the possibility of null values.
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.
String toString(Object val)
Protected Methods
abstract Object toExternalFormat(byte[] bytes)
Convert the byte[] into the expected object type
abstract byte[] toInternalFormat(Object bytes)
Convert the object into the internal byte[] representation
[Expand]
Inherited Methods
From class org.hibernate.type.MutableType
From class org.hibernate.type.NullableType
From class org.hibernate.type.AbstractType
From class java.lang.Object
From interface java.util.Comparator
From interface org.hibernate.type.StringRepresentableType
From interface org.hibernate.type.Type
From interface org.hibernate.type.VersionType
From interface org.hibernate.type.XmlRepresentableType

Public Constructors

public AbstractBynaryType ()

Public Methods

public int compare (Object o1, Object o2)

public int compare (Object x, Object y, EntityMode entityMode)

Perform a Comparator style comparison between values

Parameters
x The first value
y The second value
entityMode The entity mode of the values.
Returns

public Object deepCopyNotNull (Object value)

public 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 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.

public Comparator getComparator ()

Get a comparator for version values.

Returns
  • The comparator to use to compare different version values.

public int getHashCode (Object x, EntityMode entityMode)

Get a hash code, consistent with persistence "equality". Again for most types the normal usage is to delegate to the value's #hashCode.

Parameters
x The value for which to retrieve a hash code
entityMode The entity mode of the value.
Returns
  • The hash code

public abstract String getName ()

Returns the abbreviated name of the type.

Returns
  • String the Hibernate type name

public boolean isEqual (Object x, Object y)

public Object next (Object current, SessionImplementor session)

public Object seed (SessionImplementor session)

Generate an initial version.

Parameters
session The session from which this request originates.
Returns
  • an instance of the type

public 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.

public 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 String toString (Object val)

Protected Methods

protected abstract Object toExternalFormat (byte[] bytes)

Convert the byte[] into the expected object type

protected abstract byte[] toInternalFormat (Object bytes)

Convert the object into the internal byte[] representation