org.castor.ddlgen.keygenerator

Class SequenceKeyGeneratorFactory

Implemented Interfaces:
KeyGeneratorFactory
Known Direct Subclasses:
Db2SequenceKeyGeneratorFactory, HsqlSequenceKeyGeneratorFactory, OracleSequenceKeyGeneratorFactory, PostgresqlSequenceKeyGeneratorFactory, SapdbSequenceKeyGeneratorFactory

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

Abstract base class for SEQUENCE key generator factories.
Version:
$Revision: 5951 $ $Date: 2006-04-25 16:09:10 -0600 (Tue, 25 Apr 2006) $
Authors:
Le Duc Bao
Ralf Joachim
Since:
1.1

Method Summary

KeyGenerator
createKeyGenerator()
KeyGenerator
createKeyGenerator(KeyGeneratorDef definition)
String
getAlgorithmName()
boolean
hasMandatoryParameters()
abstract void
toCreateDDL(KeyGenerator key, DDLWriter writer)
Generate create script for given SEQUENCE key generator.
abstract void
toDropDDL(KeyGenerator key, DDLWriter writer)
Generate drop script for given SEQUENCE key generator.
protected String
toPrimaryKeyList(Table table)
Build a string containing names of all primary key columns separated by '_'.
protected String
toPrimaryKeyTypeList(Table table)
Build a string containing types of all primary key columns separated by '_'.

Method Details

createKeyGenerator

public final KeyGenerator createKeyGenerator()
            throws GeneratorException
Specified by:
createKeyGenerator in interface KeyGeneratorFactory

createKeyGenerator

public final KeyGenerator createKeyGenerator(KeyGeneratorDef definition)
            throws GeneratorException
Specified by:
createKeyGenerator in interface KeyGeneratorFactory

getAlgorithmName

public final String getAlgorithmName()
Specified by:
getAlgorithmName in interface KeyGeneratorFactory

hasMandatoryParameters

public final boolean hasMandatoryParameters()
Specified by:
hasMandatoryParameters in interface KeyGeneratorFactory

toCreateDDL

public abstract void toCreateDDL(KeyGenerator key,
                                 DDLWriter writer)
Generate create script for given SEQUENCE key generator.
Parameters:
key - SEQUENCE key generator to generate DDL for.
writer - DDLWriter to write schema objects to.

toDropDDL

public abstract void toDropDDL(KeyGenerator key,
                               DDLWriter writer)
Generate drop script for given SEQUENCE key generator.
Parameters:
key - SEQUENCE key generator to generate DDL for.
writer - DDLWriter to write schema objects to.

toPrimaryKeyList

protected final String toPrimaryKeyList(Table table)
Build a string containing names of all primary key columns separated by '_'.
Parameters:
table - Table build primary key column names string for.
Returns:
String containing names of all primary key columns separated by '_'.

toPrimaryKeyTypeList

protected final String toPrimaryKeyTypeList(Table table)
Build a string containing types of all primary key columns separated by '_'.
Parameters:
table - Table build primary key column types string for.
Returns:
String containing types of all primary key columns separated by '_'.

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