public class FrontBasePkGenerator extends JdbcPkGenerator
adapter, DEFAULT_PK_CACHE_SIZE, pkCache, pkCacheSize, pkStartValue
Constructor and Description |
---|
FrontBasePkGenerator(JdbcAdapter adapter) |
Modifier and Type | Method and Description |
---|---|
void |
createAutoPk(DataNode node,
List<DbEntity> dbEntities)
Generates necessary database objects to provide automatic primary key support.
|
List<String> |
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.
|
void |
dropAutoPk(DataNode node,
List<DbEntity> dbEntities)
Drops table named "AUTO_PK_SUPPORT" if it exists in the database.
|
protected String |
dropAutoPkString() |
int |
getPkCacheSize()
Retruns zero as PK caching is not supported by FrontBaseAdapter.
|
protected long |
longPkFromDatabase(DataNode node,
DbEntity entity)
Performs primary key generation ignoring cache.
|
protected String |
pkCreateString(String entName) |
protected String |
pkDeleteString(List<DbEntity> dbEntities) |
protected String |
pkSelectString(String entName) |
protected String |
pkTableCreateString() |
protected String |
pkUpdateString(String entName) |
autoPkTableExists, dropAutoPkStatements, generatePk, getAdapter, reset, runUpdate, setPkCacheSize
public FrontBasePkGenerator(JdbcAdapter adapter)
public int getPkCacheSize()
getPkCacheSize
in class JdbcPkGenerator
public void createAutoPk(DataNode node, List<DbEntity> dbEntities) throws Exception
PkGenerator
createAutoPk
in interface PkGenerator
createAutoPk
in class JdbcPkGenerator
node
- node that provides access to a DataSource.dbEntities
- a list of entities that require primary key auto-generation
supportException
public List<String> createAutoPkStatements(List<DbEntity> dbEntities)
PkGenerator
createAutoPkStatements
in interface PkGenerator
createAutoPkStatements
in class JdbcPkGenerator
public void dropAutoPk(DataNode node, List<DbEntity> dbEntities) throws Exception
JdbcPkGenerator
dropAutoPk
in interface PkGenerator
dropAutoPk
in class JdbcPkGenerator
node
- node that provides access to a DataSource.dbEntities
- a list of entities whose primary key auto-generation support
should be dropped.Exception
protected String pkTableCreateString()
pkTableCreateString
in class JdbcPkGenerator
protected String pkDeleteString(List<DbEntity> dbEntities)
pkDeleteString
in class JdbcPkGenerator
protected String pkCreateString(String entName)
pkCreateString
in class JdbcPkGenerator
protected String pkSelectString(String entName)
pkSelectString
in class JdbcPkGenerator
protected String pkUpdateString(String entName)
pkUpdateString
in class JdbcPkGenerator
protected String dropAutoPkString()
dropAutoPkString
in class JdbcPkGenerator
protected long longPkFromDatabase(DataNode node, DbEntity entity) throws Exception
JdbcPkGenerator
This method is called internally from "generatePkForDbEntity" and then generated range of key values is saved in cache for performance. Subclasses that implement different primary key generation solutions should override this method, not "generatePkForDbEntity".
longPkFromDatabase
in class JdbcPkGenerator
Exception
Copyright © 2001–2015 Apache Cayenne. All rights reserved.