1 //$Id: VersionType.java,v 1.3 2005/02/16 12:50:19 oneovthafew Exp $ 2 package org.hibernate.type; 3 4 import java.util.Comparator; 5 6 /** 7 * A <tt>Type</tt> that may be used to version data. 8 * @author Gavin King 9 */ 10 public interface VersionType extends Type { 11 /** 12 * Generate an initial version. 13 * @return an instance of the type 14 */ 15 public Object seed(); 16 /** 17 * Increment the version. 18 * @param current the current version 19 * @return an instance of the type 20 */ 21 public Object next(Object current); 22 /** 23 * Get a comparator for the version numbers 24 */ 25 public Comparator getComparator(); 26 27 public boolean isEqual(Object x, Object y); 28 } 29 30 31 32 33 34 35