Package org.castor.ddlgen.keygenerator
Class IdentityKeyGenerator
java.lang.Object
org.castor.ddlgen.schemaobject.AbstractSchemaObject
org.castor.ddlgen.schemaobject.KeyGenerator
org.castor.ddlgen.keygenerator.IdentityKeyGenerator
- All Implemented Interfaces:
SchemaObject
IDENTITY key generator can be used only with autoincrement primary key columns
(identities) with Sybase ASE/ASA, MS SQL Server, MySQL and Hypersonic SQL.
After the insert the key generator selects system variable @@identity which
contains the last identity value for the current database connection. In the case
of MySQL and Hypersonic SQL the system functions LAST_INSERT_ID() and IDENTITY()
are called, respectively.
- 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
ConstructorsConstructorDescriptionConstructor for default IDENTITY key generator.IdentityKeyGenerator
(KeyGeneratorDef definition) Constructor for IDENTITY key generator specified by given defintion. -
Method Summary
Modifier and TypeMethodDescriptionvoid
toCreateDDL
(DDLWriter writer) Build create script for the schema object.void
Build drop script for the schema object.Methods inherited from class org.castor.ddlgen.schemaobject.KeyGenerator
equals, getAlias, getTable, hashCode, merge, setAlias, setTable
Methods 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
-
IdentityKeyGenerator
public IdentityKeyGenerator()Constructor for default IDENTITY key generator. -
IdentityKeyGenerator
Constructor for IDENTITY key generator specified by given defintion.- Parameters:
definition
- Key generator definition.
-
-
Method Details
-
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.
-