public interface Database
Modifier and Type | Method and Description |
---|---|
Index |
createIndex(String tableName,
String indexName,
List<Field> fields,
boolean isUnique)
Creates a new index on the table.
|
Sequence |
createSequence(String name,
int cacheSize)
Creates a new sequence in the database.
|
Table |
createTable(String name,
List<Field> keyFields,
List<Field> fields)
Creates a new table in the database.
|
Table |
createTable(String name,
List<Field> keyFields,
List<Field> fields,
int flags)
Creates a new table in the database.
|
Table |
createTable(String name,
List<Field> keyFields,
List<Field> fields,
List<Constraint> constraints)
Creates a new table in the database.
|
Table |
createTable(String name,
List<Field> keyFields,
List<Field> fields,
List<Constraint> constraints,
int flags)
Creates a new table in the database.
|
Table |
createTable(String name,
List<Field> keyFields,
List<Field> fields,
List<Constraint> constraints,
String splitKey)
Creates a new table in the database using a field as a splitPoint for bidimensional partitioning.
|
Table |
createTable(String name,
List<Field> keyFields,
List<Field> fields,
List<Constraint> constraints,
String splitKey,
int flags)
Creates a new table in the database using a field as a splitPoint for bidimensional partitioning.
|
Table |
createTable(String name,
List<Field> keyFields,
List<Field> fields,
String splitKey)
Creates a new table in the database using a field as a splitPoint for bidimensional partitioning.
|
Table |
createTable(String name,
List<Field> keyFields,
List<Field> fields,
String splitKey,
int flags)
Creates a new table in the database using a field as a splitPoint for bidimensional partitioning.
|
void |
dropIndex(String tableName,
String indexName)
Drops an index from a table.
|
void |
dropSequence(String name)
Drops a sequence from the database.
|
void |
dropTable(String name)
Drops a table, including the data inside the table.
|
Index |
getIndex(String fromTableName,
String name)
Returns an index given its name.
|
Collection<Index> |
getIndexes(String tableName)
Returns the table index list.
|
Sequence |
getSequence(String name)
Retrieves an existing sequence given its name.
|
Collection<Sequence> |
getSequences()
Retrieves the full list of database sequences.
|
Table |
getTable(String name)
Retrieves an existing table given its name.
|
Collection<Table> |
getTables()
Retrieves the full list of database tables.
|
boolean |
tableExists(String tableName)
Return if a table exixts or not.
|
Table createTable(String name, List<Field> keyFields, List<Field> fields)
name
- Name of the table. Must be unique inside the database.keyFields
- List of Field objects which represents th PK of the tablefields
- List of Field objects which represent the fields which are not in the PKTable createTable(String name, List<Field> keyFields, List<Field> fields, int flags)
name
- Name of the table. Must be unique inside the database.keyFields
- List of Field objects which represents th PK of the tablefields
- List of Field objects which represent the fields which are not in the PKflags
- Special data-store flags for table creationTable createTable(String name, List<Field> keyFields, List<Field> fields, String splitKey)
name
- Name of the table. Must be unique inside the database.keyFields
- List of Field objects which represents th PK of the tablefields
- List of Field objects which represent the fields which are not in the PKsplitKey
- Name of the key field which will be used to do bidimensional partitioningTable createTable(String name, List<Field> keyFields, List<Field> fields, String splitKey, int flags)
name
- Name of the table. Must be unique inside the database.keyFields
- List of Field objects which represents th PK of the tablefields
- List of Field objects which represent the fields which are not in the PKsplitKey
- Name of the key field which will be used to do bidimensional partitioningflags
- Special data-store flags for table creationTable createTable(String name, List<Field> keyFields, List<Field> fields, List<Constraint> constraints)
name
- Name of the table. Must be unique inside the database.keyFields
- List of Field objects which represents th PK of the tablefields
- List of Field objects which represent the fields which are not in the PKconstraints
- List of constraints to be included on the table.Table createTable(String name, List<Field> keyFields, List<Field> fields, List<Constraint> constraints, int flags)
name
- Name of the table. Must be unique inside the database.keyFields
- List of Field objects which represents th PK of the tablefields
- List of Field objects which represent the fields which are not in the PKconstraints
- List of constraints to be included on the table.flags
- Special data-store flags for table creationTable createTable(String name, List<Field> keyFields, List<Field> fields, List<Constraint> constraints, String splitKey)
name
- Name of the table. Must be unique inside the database.keyFields
- List of Field objects which represents th PK of the tablefields
- List of Field objects which represent the fields which are not in the PKconstraints
- List of constraints to be included on the table.splitKey
- Name of the key field which will be used to do bidimensional partitioningTable createTable(String name, List<Field> keyFields, List<Field> fields, List<Constraint> constraints, String splitKey, int flags)
name
- Name of the table. Must be unique inside the database.keyFields
- List of Field objects which represents th PK of the tablefields
- List of Field objects which represent the fields which are not in the PKconstraints
- List of constraints to be included on the table.splitKey
- Name of the key field which will be used to do bidimensional partitioningflags
- Special data-store flags for table creationvoid dropTable(String name)
name
- Name of the table.Sequence createSequence(String name, int cacheSize)
name
- Name of the sequence. Must be unique.cacheSize
- Size of the precached values blockvoid dropSequence(String name)
name
- name of the sequence to be dropped.Table getTable(String name)
name
- Name of the table to be retrieved.Collection<Table> getTables()
boolean tableExists(String tableName)
tableName
- Name of the table.Sequence getSequence(String name)
name
- Name of the sequence.Collection<Sequence> getSequences()
Index createIndex(String tableName, String indexName, List<Field> fields, boolean isUnique)
tableName
- the name of the table to create the indexindexName
- Name of the new indexfields
- Field list of the indexisUnique
- Indicates if the index is uniqueIllegalArgumentException
- In case of the index does not comply with the restrictions defined
above.NotCompatibleTableModelException
- In case of some index field is not present in the table.void dropIndex(String tableName, String indexName)
tableName
- the name of the table to drop the indexindexName
- Name of the index to be dropped.Collection<Index> getIndexes(String tableName)
tableName
- Name of the table to get the indexesCopyright © 2020. All rights reserved.