org.exolab.castor.jdo.keygen
Class UUIDKeyGeneratorFactory
java.lang.Object
org.exolab.castor.jdo.keygen.UUIDKeyGeneratorFactory
- All Implemented Interfaces:
- KeyGeneratorFactory
public final class UUIDKeyGeneratorFactory
- extends java.lang.Object
- implements KeyGeneratorFactory
UUID key generator factory.
The short name of this key generator is "UUID".
It uses the following alrorithm:
The uuid is a combination of the IP address, the current
time in milliseconds since 1970 and a static counter.
The complete key consists of a 30 character fixed length string.
Brief statement:
The ip only exists once during runtime of castor, the
current time in milliseconds (updated every 55 mills) is
in combination to the ip pretty unique. considering a static
counter will be used a database-wide unique key will be created.
- Version:
- $Revision: 1.1 $ $Date: 2005/06/01 12:08:16 $
- Author:
- Thomas Fach
- See Also:
UUIDKeyGenerator
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
UUIDKeyGeneratorFactory
public UUIDKeyGeneratorFactory()
getKeyGenerator
public KeyGenerator getKeyGenerator(PersistenceFactory factory,
java.util.Properties params,
int sqlType)
throws MappingException
- Produce the key generator.
- Specified by:
getKeyGenerator
in interface KeyGeneratorFactory
- Parameters:
factory
- Helper object for obtaining database-specific QuerySyntax.params
- Parameters for key generator.sqlType
- The SQL type of the primary key,
the generated identities must have the corresponding Java type,
e.g. java.sql.Types.INTEGER corresponds to java.lang.Integer,
java.sql.Types.NUMERIC corresponds to java.lang.BigDecimal.
- Throws:
MappingException
- Factory:
- Helper object for obtaining database-specific QuerySyntax.
getName
public java.lang.String getName()
- The short name of this key generator is "UUID"
- Specified by:
getName
in interface KeyGeneratorFactory
Intalio Inc. (C) 1999-2004. All rights reserved http://www.intalio.com