public interface

JavaTypeDescriptor

implements Serializable
org.hibernate.type.descriptor.java.JavaTypeDescriptor<T>
Known Indirect Subclasses

Class Overview

Descriptor for the Java side of a value mapping.

Summary

Public Methods
abstract boolean areEqual(T one, T another)
Determine if two instances are equal
abstract int extractHashCode(T value)
Extract a proper hash code for this value.
abstract String extractLoggableRepresentation(T value)
Extract a loggable representation of the value.
abstract T fromString(String string)
abstract Comparator<T> getComparator()
Retrieve the natural comparator for this type.
abstract Class<T> getJavaTypeClass()
Retrieve the Java type handled here.
abstract MutabilityPlan<T> getMutabilityPlan()
Retrieve the mutability plan for this Java type.
abstract String toString(T value)
abstract <X> X unwrap(T value, Class<X> type, WrapperOptions options)
Unwrap an instance of our handled Java type into the requested type.
abstract <X> T wrap(X value, WrapperOptions options)
Wrap a value as our handled Java type.

Public Methods

public abstract boolean areEqual (T one, T another)

Determine if two instances are equal

Parameters
one One instance
another The other instance
Returns
  • True if the two are considered equal; false otherwise.

public abstract int extractHashCode (T value)

Extract a proper hash code for this value.

Parameters
value The value for which to extract a hash code.
Returns
  • The extracted hash code.

public abstract String extractLoggableRepresentation (T value)

Extract a loggable representation of the value.

Parameters
value The value for which to extract a loggable representation.
Returns
  • The loggable representation

public abstract T fromString (String string)

public abstract Comparator<T> getComparator ()

Retrieve the natural comparator for this type.

Returns
  • The natural comparator.

public abstract Class<T> getJavaTypeClass ()

Retrieve the Java type handled here.

Returns
  • The Java type.

public abstract MutabilityPlan<T> getMutabilityPlan ()

Retrieve the mutability plan for this Java type.

Returns
  • The mutability plan

public abstract String toString (T value)

public abstract X unwrap (T value, Class<X> type, WrapperOptions options)

Unwrap an instance of our handled Java type into the requested type.

As an example, if this is a JavaTypeDescriptor<Integer> and we are asked to unwrap the Integer value as a Long we would return something like Long.valueOf( value.longValue() ).

Intended use is during PreparedStatement binding.

Parameters
value The value to unwrap
type The type as which to unwrap
options The options
Returns
  • The unwrapped value.

public abstract T wrap (X value, WrapperOptions options)

Wrap a value as our handled Java type.

Intended use is during ResultSet extraction.

Parameters
value The value to wrap.
options The options
Returns
  • The wrapped value.