org.hibernate.type
Class ByteType

java.lang.Object
  extended by org.hibernate.type.AbstractStandardBasicType<T>
      extended by org.hibernate.type.AbstractSingleColumnStandardBasicType<Byte>
          extended by org.hibernate.type.ByteType
All Implemented Interfaces:
Serializable, BasicType, DiscriminatorType<Byte>, IdentifierType<Byte>, LiteralType<Byte>, PrimitiveType<Byte>, SingleColumnType<Byte>, StringRepresentableType<Byte>, Type, VersionType<Byte>, XmlRepresentableType<Byte>

public class ByteType
extends AbstractSingleColumnStandardBasicType<Byte>
implements PrimitiveType<Byte>, DiscriminatorType<Byte>, VersionType<Byte>

A type that maps between TINYINT and Byte

See Also:
Serialized Form

Field Summary
static ByteType INSTANCE
           
 
Constructor Summary
ByteType()
           
 
Method Summary
 Byte fromStringValue(String xml)
          Consume the given string representation back into this types java form.
 Comparator<Byte> getComparator()
          Get a comparator for version values.
 Serializable getDefaultValue()
          Get this type's default value.
 String getName()
          Returns the abbreviated name of the type.
 Class getPrimitiveClass()
          Retrieve the primitive counterpart to the wrapper type identified by Type.getReturnedClass().
 String[] getRegistrationKeys()
          Get the names under which this type should be registered in the type registry.
 Byte next(Byte current, SessionImplementor session)
          Increment the version.
 String objectToSQLString(Byte value, Dialect dialect)
          Convert the value into a string representation, suitable for embedding in an SQL statement as a literal.
 Byte seed(SessionImplementor session)
          Generate an initial version.
 Byte stringToObject(String xml)
          Convert the value from the mapping file to a Java object.
 
Methods inherited from class org.hibernate.type.AbstractSingleColumnStandardBasicType
nullSafeSet, sqlType
 
Methods inherited from class org.hibernate.type.AbstractStandardBasicType
assemble, beforeAssemble, compare, deepCopy, deepCopy, defaultSizes, dictatedSizes, disassemble, fromString, fromXMLNode, fromXMLString, get, getColumnSpan, getDefaultSize, getDictatedSize, getHashCode, getHashCode, getJavaTypeDescriptor, getMutabilityPlan, getReplacement, getReturnedClass, getSemiResolvedType, getSqlTypeDescriptor, hydrate, isAnyType, isAssociationType, isCollectionType, isComponentType, isDirty, isDirty, isDirty, isEntityType, isEqual, isEqual, isModified, isMutable, isSame, isXMLElement, nullSafeGet, nullSafeGet, nullSafeGet, nullSafeGet, nullSafeSet, nullSafeSet, registerUnderJavaType, remapSqlTypeDescriptor, replace, replace, resolve, semiResolve, set, setJavaTypeDescriptor, setSqlTypeDescriptor, 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.PrimitiveType
toString
 
Methods inherited from interface org.hibernate.type.Type
assemble, beforeAssemble, compare, deepCopy, defaultSizes, dictatedSizes, disassemble, fromXMLNode, getColumnSpan, getHashCode, getHashCode, getReturnedClass, getSemiResolvedType, hydrate, isAnyType, isAssociationType, isCollectionType, isComponentType, isDirty, isDirty, isEntityType, isEqual, isEqual, isModified, isMutable, isSame, isXMLElement, nullSafeGet, nullSafeGet, nullSafeSet, nullSafeSet, replace, replace, resolve, semiResolve, setToXMLNode, sqlTypes, toColumnNullness, toLoggableString
 
Methods inherited from interface org.hibernate.type.SingleColumnType
get, nullSafeGet, set, toString
 

Field Detail

INSTANCE

public static final ByteType INSTANCE
Constructor Detail

ByteType

public ByteType()
Method Detail

getName

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

Specified by:
getName in interface Type
Returns:
String the Hibernate type name

getRegistrationKeys

public String[] getRegistrationKeys()
Description copied from interface: BasicType
Get the names under which this type should be registered in the type registry.

Specified by:
getRegistrationKeys in interface BasicType
Overrides:
getRegistrationKeys in class AbstractStandardBasicType<Byte>
Returns:
The keys under which to register this type.

getDefaultValue

public Serializable getDefaultValue()
Description copied from interface: PrimitiveType
Get this type's default value.

Specified by:
getDefaultValue in interface PrimitiveType<Byte>
Returns:
The default value.

getPrimitiveClass

public Class getPrimitiveClass()
Description copied from interface: PrimitiveType
Retrieve the primitive counterpart to the wrapper type identified by Type.getReturnedClass().

Specified by:
getPrimitiveClass in interface PrimitiveType<Byte>
Returns:
The primitive Java type.

objectToSQLString

public String objectToSQLString(Byte value,
                                Dialect dialect)
Description copied from interface: LiteralType
Convert the value into a string representation, suitable for embedding in an SQL statement as a literal.

Specified by:
objectToSQLString in interface LiteralType<Byte>
Parameters:
value - The value to convert
dialect - The SQL dialect
Returns:
The value's string representation

stringToObject

public Byte stringToObject(String xml)
Description copied from interface: IdentifierType
Convert the value from the mapping file to a Java object.

Specified by:
stringToObject in interface IdentifierType<Byte>
Parameters:
xml - the value of discriminator-value or unsaved-value attribute
Returns:
The converted value of the string representation.

fromStringValue

public Byte fromStringValue(String xml)
Description copied from interface: StringRepresentableType
Consume the given string representation back into this types java form.

Specified by:
fromStringValue in interface SingleColumnType<Byte>
Specified by:
fromStringValue in interface StringRepresentableType<Byte>
Overrides:
fromStringValue in class AbstractStandardBasicType<Byte>
Parameters:
xml - The string representation to be consumed.
Returns:
The java type representation

next

public Byte next(Byte current,
                 SessionImplementor session)
Description copied from interface: VersionType
Increment the version.

Specified by:
next in interface VersionType<Byte>
Parameters:
current - the current version
session - The session from which this request originates.
Returns:
an instance of the type

seed

public Byte seed(SessionImplementor session)
Description copied from interface: VersionType
Generate an initial version.

Specified by:
seed in interface VersionType<Byte>
Parameters:
session - The session from which this request originates.
Returns:
an instance of the type

getComparator

public Comparator<Byte> getComparator()
Description copied from interface: VersionType
Get a comparator for version values.

Specified by:
getComparator in interface VersionType<Byte>
Returns:
The comparator to use to compare different version values.


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