public final class DirtyTempTableHelper extends TempTableHelper
This class is responsible for global temporary tables support: the created tables and indices will be global and available to all sessions.
Modifier and Type | Field and Description |
---|---|
private static java.util.Map<Database,java.util.Map<java.lang.String,java.util.ArrayList<P2JIndex>>> |
indexCache
Cache with the indexes retrieved from the database, for each table and database.
|
private static java.util.logging.Logger |
LOG
Logger
|
database, schema, UNIQUE_SUFFIX_KEY
Constructor and Description |
---|
DirtyTempTableHelper(java.lang.Class<? extends DataModelObject> dmoIface,
Database database)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
(package private) java.lang.String |
getAdditionalIndexSuffix()
This method returns an empty string: the indexes must be global.
|
(package private) java.lang.String |
getCreateTableStatement()
This method will return the needed create table string, which is the
"create temporary table" string.
|
(package private) java.util.Iterator<P2JIndex> |
getIndexes(java.lang.String schema,
java.lang.Class<? extends DataModelObject> dmoIface)
This method will return the indexes associated with a certain DMO, as
found in the associated database.
|
(package private) boolean |
isNotNullAllowed()
Indicate whether non-nullable columns are permitted.
|
get, getImplicitIndexName, getImplicitSqlIndexName, getTableName, sqlTempTableCreate, sqlTempTableDrop, sqlTempTableIndexCreate, sqlTempTableIndexDrop
DirtyTempTableHelper(java.lang.Class<? extends DataModelObject> dmoIface, Database database)
dmoIface
- DMO interface which provides the public API to the temp table.database
- The database for which we generate the sql's.java.lang.String getCreateTableStatement()
getCreateTableStatement
in class TempTableHelper
java.lang.String getAdditionalIndexSuffix()
getAdditionalIndexSuffix
in class TempTableHelper
java.util.Iterator<P2JIndex> getIndexes(java.lang.String schema, java.lang.Class<? extends DataModelObject> dmoIface)
Once retrieved, the indexes will be kept in a cache
,
for each table, by database.
getIndexes
in class TempTableHelper
schema
- The schema used for this DMO.dmoIface
- The DMO for which to retrieve the indexes.java.lang.RuntimeException
- if there is any error retrieving the index metadata for the given schema and DMO.boolean isNotNullAllowed()
isNotNullAllowed
in class TempTableHelper
true
if non-nullable columns are permitted, else false
.