org.exolab.castor.jdo.drivers
Class HighLowKeyGeneratorFactory
java.lang.Object
org.exolab.castor.jdo.drivers.HighLowKeyGeneratorFactory
- KeyGeneratorFactory
public final class HighLowKeyGeneratorFactory
extends java.lang.Object
HIGH-LOW key generator factory.
The short name of this key generator is "HIGH-LOW".
It uses the following alrorithm: a special sequence table must be in
the database with keeps the maximum key values. The name of the
sequence table is a mandatory parameter of the key generator,
the parameter name is "table".
The name of the primary key column of the sequence table and
the name of the column in which maximum values are stored are
mandatory parameters with the names "key-column" and "value-column",
respectively. The key column contains table names, so it must be of
a character type (char or varchar). The value column contains primary key
values, it must be of a numeric type (numeric or int).
Key generator reads the maximum value X for the given table,
writes the new value (X + N) to the sequence table and during next N
calls returns values X + 1, ..., X + N without database access.
Number N (which sometimes is called "grab size") is an optional
parameter of the key generator, the parameter name is "grab-size",
default value is "1".
For example, if you want to obtain HIGH-LOW key generator with
3 digits in the LOW part of the key, you should set "grab-size" to "1000".
$Revision: 1.1.1.1 $ $Date: 2003/03/03 07:08:11 $
Intalio Inc. (C) 1999-2003. All rights reserved http://www.intalio.com