org.exolab.castor.jdo.keygen
Class SequenceKeyGeneratorFactory

java.lang.Object
  extended by org.exolab.castor.jdo.keygen.SequenceKeyGeneratorFactory
All Implemented Interfaces:
KeyGeneratorFactory

public final class SequenceKeyGeneratorFactory
extends java.lang.Object
implements KeyGeneratorFactory

SEQUENCE key generator factory. The short name of this key generator is "SEQUENCE". It uses Oracle/PostrgeSQL SEQUENCEs There are two optional parameters for this key generator: 1) name is "sequence" and the default value is "{0}_seq"; 2) name is "returning", values: "true"/"false", default is "false". The latter parameter should be used only with Oracle8i, "true" value turns on more efficient RETURNING syntax. It is possible to use naming patterns like this for obtaining SEQUENCE name by table name. This gives the possibility to use one global key generator declaration rather than one per table.

Version:
$Revision: 1.1 $ $Date: 2005/06/01 12:08:16 $
Author:
Oleg Nitz
See Also:
SequenceKeyGenerator

Constructor Summary
SequenceKeyGeneratorFactory()
           
 
Method Summary
 KeyGenerator getKeyGenerator(PersistenceFactory factory, java.util.Properties params, int sqlType)
          Produce the key generator.
 java.lang.String getName()
          The short name of this key generator is "SEQUENCE"
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SequenceKeyGeneratorFactory

public SequenceKeyGeneratorFactory()
Method Detail

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 "SEQUENCE"

Specified by:
getName in interface KeyGeneratorFactory


Intalio Inc. (C) 1999-2004. All rights reserved http://www.intalio.com