站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > Hibernate 3.2.4 正式版 API 英文文档

VersionType (Hibernate API Documentation) - Hibernate 3.2.4 正式版 API 英文文档


org.hibernate.type
Interface VersionType

All Superinterfaces:
Serializable, Type
All Known Implementing Classes:
AbstractBynaryType, ByteType, CalendarType, CustomType, DbTimestampType, IntegerType, LongType, ShortType, TimestampType

public interface VersionType
extends Type

A Type that may be used to version data.

Author:
Gavin King

Method Summary
 Comparator getComparator()
          Get a comparator for version values.
 boolean isEqual(Object x, Object y)
          Are the two version values considered equal?
 Object next(Object current, SessionImplementor session)
          Increment the version.
 Object seed(SessionImplementor session)
          Generate an initial version.
 
Methods inherited from interface org.hibernate.type.Type
assemble, beforeAssemble, compare, deepCopy, disassemble, fromXMLNode, getColumnSpan, getHashCode, getHashCode, getName, 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
 

Method Detail

seed

public Object seed(SessionImplementor session)
Generate an initial version.

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

next

public Object next(Object current,
                   SessionImplementor session)
Increment the version.

Parameters:
session - The session from which this request originates.
current - the current version
Returns:
an instance of the type

getComparator

public Comparator getComparator()
Get a comparator for version values.

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

isEqual

public boolean isEqual(Object x,
                       Object y)
Are the two version values considered equal?

Parameters:
x - One value to check.
y - The other value to check.
Returns:
true if the values are equal, false otherwise.