Interface PkGenerator
- All Known Implementing Classes:
DB2PkGenerator, DerbyPkGenerator, FrontBasePkGenerator, H2PkGenerator, IngresPkGenerator, JdbcPkGenerator, MySQLPkGenerator, OraclePkGenerator, PostgresPkGenerator, SequencePkGenerator, SQLServerPkGenerator, SybasePkGenerator
public interface PkGenerator
Defines methods to support automatic primary key generation.
-
Method Summary
Modifier and TypeMethodDescriptionvoidcreateAutoPk(DataNode node, List<DbEntity> dbEntities) Generates necessary database objects to provide automatic primary key support.createAutoPkStatements(List<DbEntity> dbEntities) Returns a list of SQL strings needed to generates database objects to provide automatic primary support for the list of entities.voiddropAutoPk(DataNode node, List<DbEntity> dbEntities) Drops any common database objects associated with automatic primary key generation process.dropAutoPkStatements(List<DbEntity> dbEntities) Returns SQL string needed to drop database objects associated with automatic primary key generation.default ObjectgeneratePk(DataNode dataNode, DbAttribute pk) Deprecated, for removal: This API element is subject to removal in a future version.generatePk(DataNode dataNode, DbAttribute pk, Class<?> javaType) Generates a unique and non-repeating primary key for the specified PK attributeGet an adapter associated with current PkGeneratorvoidreset()Resets any cached primary keys forcing generator to go to the database next time id generation is requested.
-
Method Details
-
createAutoPk
-
createAutoPkStatements
-
dropAutoPk
Drops any common database objects associated with automatic primary key generation process. This may be lookup tables, special stored procedures or sequences.- Parameters:
node- node that provides access to a DataSource.dbEntities- a list of entities whose primary key auto-generation support should be dropped.
-
dropAutoPkStatements
-
generatePk
@Deprecated(since="5.0", forRemoval=true) default Object generatePk(DataNode dataNode, DbAttribute pk) Deprecated, for removal: This API element is subject to removal in a future version.unused by the framework that relies ongeneratePk(DataNode, DbAttribute, Class)Generates a unique and non-repeating primary key for specified PK attribute. -
generatePk
Generates a unique and non-repeating primary key for the specified PK attribute- Since:
- 5.0
-
getAdapter
-
reset
void reset()Resets any cached primary keys forcing generator to go to the database next time id generation is requested. May not be applicable for all generator implementations.
-
generatePk(DataNode, DbAttribute, Class)