Package org.castor.ddlgen.keygenerator
Class HighLowKeyGenerator
java.lang.Object
org.castor.ddlgen.schemaobject.AbstractSchemaObject
org.castor.ddlgen.schemaobject.KeyGenerator
org.castor.ddlgen.keygenerator.HighLowKeyGenerator
- All Implemented Interfaces:
SchemaObject
HIGH-LOW key generator will be handled by Castor so no DDL needs to be created. It
only requires a table to lookup the next values to be used.
- Since:
- 1.1
- Version:
- $Revision: 5951 $ $Date: 2006-04-25 16:09:10 -0600 (Tue, 25 Apr 2006) $
- Author:
- Le Duc Bao, Ralf Joachim
-
Field Summary
FieldsFields inherited from class org.castor.ddlgen.schemaobject.AbstractSchemaObject
HASHFACTOR -
Constructor Summary
ConstructorsConstructorDescriptionHighLowKeyGenerator(KeyGeneratorDef definition) Constructor for HIGH-LOW key generator specified by given defintion. -
Method Summary
Modifier and TypeMethodDescriptionintGet number of new keys the key generator should grab from the sequence table at a time.Get name of the column which contains table names.Get name of the special sequence table.Get name of the column which is used to reserve primary key values.booleanisGlobal()Shell globally unique keys be generated?booleanShell the same Connection be used for writing to the sequence table?voidtoCreateDDL(DDLWriter writer) Build create script for the schema object.voidBuild drop script for the schema object.Methods inherited from class org.castor.ddlgen.schemaobject.KeyGenerator
equals, getAlias, getTable, hashCode, merge, setAlias, setTableMethods inherited from class org.castor.ddlgen.schemaobject.AbstractSchemaObject
equals, getConfiguration, getName, setConfiguration, setName
-
Field Details
-
ALGORITHM_NAME
Name of key generator algorithm.- See Also:
-
-
Constructor Details
-
HighLowKeyGenerator
Constructor for HIGH-LOW key generator specified by given defintion.- Parameters:
definition- Key generator definition.- Throws:
GeneratorException- If grab size parameter can't be parsed as integer.
-
-
Method Details
-
getTableName
Get name of the special sequence table.- Returns:
- Name of the special sequence table.
-
getKeyColumn
Get name of the column which contains table names.- Returns:
- Name of the column which contains table names.
-
getValueColumn
Get name of the column which is used to reserve primary key values.- Returns:
- Name of the column which is used to reserve primary key values.
-
getGrabSize
public int getGrabSize()Get number of new keys the key generator should grab from the sequence table at a time.- Returns:
- Number of new keys the key generator should grab from the sequence table at a time.
-
isSameConnection
public boolean isSameConnection()Shell the same Connection be used for writing to the sequence table?- Returns:
- If
trueit uses the same connection t write to the sequence table.
-
isGlobal
public boolean isGlobal()Shell globally unique keys be generated?- Returns:
- If
trueglobally unique keys are generated.
-
toCreateDDL
Build create script for the schema object.- Parameters:
writer- DDLWriter to write schema objects to.
-
toDropDDL
Build drop script for the schema object.- Parameters:
writer- DDLWriter to write schema objects to.
-