public interface Database extends AutoCloseable
| Modifier and Type | Interface and Description |
|---|---|
static interface |
Database.Filter
A filter type that can be used with
addFilter(Filter) |
| Modifier and Type | Method and Description |
|---|---|
void |
addFilter(Database.Filter filter)
[#3488] Add an additional filter to the database that is applied in
addition to include / exclude.
|
void |
close()
Release any resources that this Database may have allocated.
|
DSLContext |
create()
Create the factory for this database.
|
boolean |
dateAsTimestamp()
Whether DATE columns should be treated as TIMESTAMP columns.
|
boolean |
existAll(Table<?>... tables)
Check for the existence of several tables in the dictionary views.
|
boolean |
exists(Table<?> table)
Check for the existence of a table in the dictionary views.
|
<D extends Definition> |
filterExcludeInclude(List<D> definitions)
Filter a list of definitions according to the exclude / include / and filter settings of this database.
|
List<Definition> |
getAll()
Retrieve all objects.
|
ArrayDefinition |
getArray(SchemaDefinition schema,
Name name)
Get a ARRAY defined in this database by name.
|
ArrayDefinition |
getArray(SchemaDefinition schema,
Name name,
boolean ignoreCase)
Get a ARRAY defined in this database by name.
|
ArrayDefinition |
getArray(SchemaDefinition schema,
String name)
Get a ARRAY defined in this database by name.
|
ArrayDefinition |
getArray(SchemaDefinition schema,
String name,
boolean ignoreCase)
Get a ARRAY defined in this database by name.
|
List<ArrayDefinition> |
getArrays(SchemaDefinition schema)
The Arrays defined in this database.
|
CatalogDefinition |
getCatalog(String name)
Get a catalog defined in this database by name.
|
List<CatalogDefinition> |
getCatalogs()
The catalogs generated from this database.
|
CatalogVersionProvider |
getCatalogVersionProvider()
The database's catalog version provider.
|
List<CheckConstraintDefinition> |
getCheckConstraints(SchemaDefinition schema)
The check constraints contained in this database.
|
CustomType |
getConfiguredCustomType(String name)
Deprecated.
- 3.10.0 - [#5750] - Use
getConfiguredForcedTypes() only. |
List<CustomType> |
getConfiguredCustomTypes()
Deprecated.
- 3.10.0 - [#5750] - Use
getConfiguredForcedTypes() only. |
List<EnumType> |
getConfiguredEnumTypes()
Database objects matching any of these field names will be generated as
enum types.
|
ForcedType |
getConfiguredForcedType(Definition definition)
Get the configured forced type object for any given
Definition,
or null if no ForcedType matches the definition. |
ForcedType |
getConfiguredForcedType(Definition definition,
DataTypeDefinition definedType)
Get the configured forced type object for any given
Definition,
or null if no ForcedType matches the definition. |
List<ForcedType> |
getConfiguredForcedTypes()
Database objects matching any of these field names will be generated as
forced types.
|
Connection |
getConnection()
The database connection.
|
SQLDialect |
getDialect()
Get the dialect for this database.
|
DomainDefinition |
getDomain(SchemaDefinition schema,
Name name)
Get an domain UDT defined in this database by name.
|
DomainDefinition |
getDomain(SchemaDefinition schema,
Name name,
boolean ignoreCase)
Get an domain UDT defined in this database by name.
|
DomainDefinition |
getDomain(SchemaDefinition schema,
String name)
Get an domain UDT defined in this database by name.
|
DomainDefinition |
getDomain(SchemaDefinition schema,
String name,
boolean ignoreCase)
Get an domain UDT defined in this database by name.
|
List<DomainDefinition> |
getDomains(SchemaDefinition schema)
The domain UDTs defined in this database.
|
EnumDefinition |
getEnum(SchemaDefinition schema,
Name name)
Get an enum UDT defined in this database by name.
|
EnumDefinition |
getEnum(SchemaDefinition schema,
Name name,
boolean ignoreCase)
Get an enum UDT defined in this database by name.
|
EnumDefinition |
getEnum(SchemaDefinition schema,
String name)
Get an enum UDT defined in this database by name.
|
EnumDefinition |
getEnum(SchemaDefinition schema,
String name,
boolean ignoreCase)
Get an enum UDT defined in this database by name.
|
List<EnumDefinition> |
getEnums(SchemaDefinition schema)
The enum UDTs defined in this database.
|
List<Definition> |
getExcluded()
Retrieve all excluded objects.
|
String[] |
getExcludes()
Database objects matching any of these regular expressions will not be
generated.
|
List<Database.Filter> |
getFilters()
[#3488] The filters that are applied in addition to include / exclude.
|
boolean |
getForceIntegerTypesOnZeroScaleDecimals()
Whether zero-scale decimal types should be treated as their most
appropriate, corresponding integer type.
|
List<ForeignKeyDefinition> |
getForeignKeys(SchemaDefinition schema)
The foreign keys contained in this database.
|
List<IdentityDefinition> |
getIdentities(SchemaDefinition schema)
The identities contained in this database.
|
List<Definition> |
getIncluded()
Retrieve all included objects.
|
boolean |
getIncludeExcludeColumns()
Indicate whether include / exclude regular expression shall also match
database columns.
|
boolean |
getIncludeForeignKeys()
whether foreign key relationships should be included.
|
boolean |
getIncludeIndexes()
whether indexes should be included.
|
boolean |
getIncludePackageConstants()
whether package constants should be included.
|
boolean |
getIncludePackageRoutines()
whether package routines should be included.
|
boolean |
getIncludePackages()
whether packages should be included.
|
boolean |
getIncludePackageUDTs()
whether package UDTs should be included.
|
boolean |
getIncludePrimaryKeys()
whether primary keys should be included.
|
boolean |
getIncludeRoutines()
whether routines should be included.
|
String[] |
getIncludes()
Only database objects matching any of these regular expressions will be
generated.
|
boolean |
getIncludeSequences()
whether sequences should be included.
|
boolean |
getIncludeTables()
Whether tables (and views) should be included.
|
boolean |
getIncludeTriggerRoutines()
whether trigger routines should be included.
|
boolean |
getIncludeUDTs()
whether user defined types should be included.
|
boolean |
getIncludeUniqueKeys()
whether unique keys should be included.
|
List<IndexDefinition> |
getIndexes(SchemaDefinition schema)
The indexes contained in this database.
|
List<IndexDefinition> |
getIndexes(TableDefinition schema)
The indexes contained in this database.
|
List<String> |
getInputCatalogs()
The input catalogs are the catalogs that jooq-meta is reading data from.
|
List<String> |
getInputSchemata()
The input schemata are the schemata from all catalogs that jooq-meta is
reading data from.
|
List<String> |
getInputSchemata(CatalogDefinition catalog)
The input schemata are the schemata from a given catalog that jooq-meta is reading data from.
|
List<String> |
getInputSchemata(String catalog)
The input schemata are the schemata from a given catalog that jooq-meta is reading data from.
|
int |
getLogSlowQueriesAfterSeconds()
Log slow queries after this amount of seconds.
|
Comparator<Definition> |
getOrderProvider()
The database's order provider.
|
String |
getOutputCatalog(String inputCatalog)
Deprecated.
- 2.0.5 - This will be implemented in each
Definition.getOutputName() |
String |
getOutputSchema(String inputSchema)
Deprecated.
- 2.0.5 - This will be implemented in each
Definition.getOutputName() |
String |
getOutputSchema(String inputCatalog,
String inputSchema)
Deprecated.
- 2.0.5 - This will be implemented in each
Definition.getOutputName() |
String[] |
getOverridePrimaryKeys()
Unique keys matching these regular expressions will be considered as
primary keys in generated code.
|
PackageDefinition |
getPackage(SchemaDefinition schema,
String inputName)
Get a package defined in this database by name.
|
List<PackageDefinition> |
getPackages(SchemaDefinition schema)
The packages contained in this database.
|
Properties |
getProperties()
Database properties.
|
String[] |
getRecordTimestampFields()
Table columns matching these regular expressions will be considered as
record timestamp fields in generated code.
|
String[] |
getRecordVersionFields()
Table columns matching these regular expressions will be considered as
record version fields in generated code.
|
List<RegexFlag> |
getRegexFlags()
The regular expression flags that should be applied when using regular expressions.
|
Relations |
getRelations()
Retrieve the schema's primary key / foreign key relations.
|
List<RoutineDefinition> |
getRoutines(SchemaDefinition schema)
The stored routines (procedures and functions) contained in this
database.
|
SchemaDefinition |
getSchema(String name)
Get a schema defined in this database by name.
|
List<SchemaDefinition> |
getSchemata()
The schemata generated from this database.
|
List<SchemaDefinition> |
getSchemata(CatalogDefinition catalog)
The schemata generated from this database and a given catalog.
|
SchemaVersionProvider |
getSchemaVersionProvider()
The database's schema version provider.
|
List<SequenceDefinition> |
getSequences(SchemaDefinition schema)
The sequences contained in this database.
|
String[] |
getSyntheticIdentities()
Columns matching these regular expressions will be considered as identity
columns in generated code.
|
String[] |
getSyntheticPrimaryKeys()
Columns matching these regular expressions will be considered as members
of synthetic primary keys in generated code.
|
TableDefinition |
getTable(SchemaDefinition schema,
Name name)
Get a table in this database by name.
|
TableDefinition |
getTable(SchemaDefinition schema,
Name name,
boolean ignoreCase)
Get a table in this database by name.
|
TableDefinition |
getTable(SchemaDefinition schema,
String name)
Get a table in this database by name.
|
TableDefinition |
getTable(SchemaDefinition schema,
String name,
boolean ignoreCase)
Get a table in this database by name.
|
List<TableDefinition> |
getTables(SchemaDefinition schema)
The tables contained in this database.
|
UDTDefinition |
getUDT(SchemaDefinition schema,
Name name)
Get a UDT defined in this database by name.
|
UDTDefinition |
getUDT(SchemaDefinition schema,
Name name,
boolean ignoreCase)
Get a UDT defined in this database by name.
|
UDTDefinition |
getUDT(SchemaDefinition schema,
String name)
Get a UDT defined in this database by name.
|
UDTDefinition |
getUDT(SchemaDefinition schema,
String name,
boolean ignoreCase)
Get a UDT defined in this database by name.
|
List<UDTDefinition> |
getUDTs(PackageDefinition pkg)
The UDTs defined in this database.
|
List<UDTDefinition> |
getUDTs(SchemaDefinition schema)
The UDTs defined in this database.
|
List<UniqueKeyDefinition> |
getUniqueKeys(SchemaDefinition schema)
The unique keys contained in this database.
|
boolean |
ignoreProcedureReturnValues()
Whether this database should ignore procedure return values.
|
boolean |
includeRelations()
[#3559] Whether relations (i.e. constraints) should be included in this database.
|
boolean |
isArrayType(String dataType)
Check whether a type is an array type.
|
void |
setCatalogVersionProvider(CatalogVersionProvider provider)
The database's catalog version provider.
|
void |
setConfiguredCatalogs(List<Catalog> catalogs)
The input and output catalogs.
|
void |
setConfiguredCustomTypes(List<CustomType> types)
Deprecated.
- 3.10.0 - [#5750] - Use
getConfiguredForcedTypes() only. |
void |
setConfiguredEnumTypes(List<EnumType> types)
Database objects matching any of these field names will be generated as
enum types.
|
void |
setConfiguredForcedTypes(List<ForcedType> types)
Database objects matching any of these field names will be generated as
forced types.
|
void |
setConfiguredSchemata(List<Schema> schemata)
The input and output schemata.
|
void |
setConnection(Connection connection)
Initialise a connection to this database.
|
void |
setDateAsTimestamp(boolean dateAsTimestamp)
Whether DATE columns should be treated as TIMESTAMP columns.
|
void |
setExcludes(String[] excludes)
Database objects matching any of these regular expressions will not be
generated.
|
void |
setForceIntegerTypesOnZeroScaleDecimals(boolean forceIntegerTypesOnZeroScaleDecimals)
Whether zero-scale decimal types should be treated as their most
appropriate, corresponding integer type.
|
void |
setIgnoreProcedureReturnValues(boolean ignoreProcedureReturnValues)
Whether this database should ignore procedure return values.
|
void |
setIncludeExcludeColumns(boolean includeExcludeColumns)
Indicate whether include / exclude regular expression shall also match
database columns.
|
void |
setIncludeForeignKeys(boolean includeForeignKeys)
whether foreign key relationships should be included.
|
void |
setIncludeIndexes(boolean includeIndexes)
whether indexes should be included.
|
void |
setIncludePackageConstants(boolean includePackageConstants)
whether package constants should be included.
|
void |
setIncludePackageRoutines(boolean includePackageRoutines)
whether package routines should be included.
|
void |
setIncludePackages(boolean includePackages)
whether packages should be included.
|
void |
setIncludePackageUDTs(boolean includePackageUDTs)
whether package UDTs should be included.
|
void |
setIncludePrimaryKeys(boolean includePrimaryKeys)
whether primary keys should be included.
|
void |
setIncludeRelations(boolean includeRelations)
[#3559] Whether relations (i.e. constraints) should be included in this database.
|
void |
setIncludeRoutines(boolean includeRoutines)
whether routines should be included.
|
void |
setIncludes(String[] includes)
Only database objects matching any of these regular expressions will be
generated.
|
void |
setIncludeSequences(boolean includeSequences)
whether sequences should be included.
|
void |
setIncludeTables(boolean includeTables)
Whether tables (and views) should be included.
|
void |
setIncludeTriggerRoutines(boolean includeTriggerRoutines)
whether trigger routines should be included.
|
void |
setIncludeUDTs(boolean includeUDTs)
whether user defined types should be included.
|
void |
setIncludeUniqueKeys(boolean includeUniqueKeys)
whether unique keys should be included.
|
void |
setLogSlowQueriesAfterSeconds(int logSlowQueriesAfterSeconds)
Log slow queries after this amount of seconds.
|
void |
setOrderProvider(Comparator<Definition> provider)
The database's order provider.
|
void |
setOverridePrimaryKeys(String[] primaryKeys)
Unique keys matching these regular expressions will be considered as
primary keys in generated code.
|
void |
setProperties(Properties properties)
Database properties.
|
void |
setRecordTimestampFields(String[] recordTimestampFields)
Table columns matching these regular expressions will be considered as
record timestamp fields in generated code.
|
void |
setRecordVersionFields(String[] recordVersionFields)
Table columns matching these regular expressions will be considered as
record version fields in generated code.
|
void |
setRegexFlags(List<RegexFlag> regexFlags)
The regular expression flags that should be applied when using regular expressions.
|
void |
setSchemaVersionProvider(SchemaVersionProvider provider)
The database's schema version provider.
|
void |
setSupportsUnsignedTypes(boolean supportsUnsignedTypes)
Whether this database supports unsigned types.
|
void |
setSyntheticIdentities(String[] syntheticIdentities)
Columns matching these regular expressions will be considered as identity
columns in generated code.
|
void |
setSyntheticPrimaryKeys(String[] primaryKeys)
Columns matching these regular expressions will be considered as members
of synthetic primary keys in generated code.
|
void |
setTableValuedFunctions(boolean tableValuedFunctions)
[#4838] Whether table-valued functions should be reported as tables.
|
<D extends Definition> |
sort(List<D> definitions)
Sort a list of definitions according to the
getOrderProvider() defined in this database. |
boolean |
supportsUnsignedTypes()
Whether this database supports unsigned types.
|
boolean |
tableValuedFunctions()
[#4838] Whether table-valued functions should be reported as tables.
|
List<CatalogDefinition> getCatalogs()
CatalogDefinition getCatalog(String name)
List<SchemaDefinition> getSchemata()
List<SchemaDefinition> getSchemata(CatalogDefinition catalog)
SchemaDefinition getSchema(String name)
Relations getRelations()
List<SequenceDefinition> getSequences(SchemaDefinition schema)
List<IdentityDefinition> getIdentities(SchemaDefinition schema)
List<IndexDefinition> getIndexes(SchemaDefinition schema)
List<IndexDefinition> getIndexes(TableDefinition schema)
List<UniqueKeyDefinition> getUniqueKeys(SchemaDefinition schema)
List<ForeignKeyDefinition> getForeignKeys(SchemaDefinition schema)
List<CheckConstraintDefinition> getCheckConstraints(SchemaDefinition schema)
List<TableDefinition> getTables(SchemaDefinition schema)
TableDefinition getTable(SchemaDefinition schema, String name)
TableDefinition getTable(SchemaDefinition schema, String name, boolean ignoreCase)
TableDefinition getTable(SchemaDefinition schema, Name name)
TableDefinition getTable(SchemaDefinition schema, Name name, boolean ignoreCase)
List<EnumDefinition> getEnums(SchemaDefinition schema)
EnumDefinition getEnum(SchemaDefinition schema, String name)
EnumDefinition getEnum(SchemaDefinition schema, String name, boolean ignoreCase)
EnumDefinition getEnum(SchemaDefinition schema, Name name)
EnumDefinition getEnum(SchemaDefinition schema, Name name, boolean ignoreCase)
List<DomainDefinition> getDomains(SchemaDefinition schema)
DomainDefinition getDomain(SchemaDefinition schema, String name)
DomainDefinition getDomain(SchemaDefinition schema, String name, boolean ignoreCase)
DomainDefinition getDomain(SchemaDefinition schema, Name name)
DomainDefinition getDomain(SchemaDefinition schema, Name name, boolean ignoreCase)
List<UDTDefinition> getUDTs(SchemaDefinition schema)
UDTDefinition getUDT(SchemaDefinition schema, String name)
UDTDefinition getUDT(SchemaDefinition schema, String name, boolean ignoreCase)
UDTDefinition getUDT(SchemaDefinition schema, Name name)
UDTDefinition getUDT(SchemaDefinition schema, Name name, boolean ignoreCase)
List<UDTDefinition> getUDTs(PackageDefinition pkg)
List<ArrayDefinition> getArrays(SchemaDefinition schema)
ArrayDefinition getArray(SchemaDefinition schema, String name)
ArrayDefinition getArray(SchemaDefinition schema, String name, boolean ignoreCase)
ArrayDefinition getArray(SchemaDefinition schema, Name name)
ArrayDefinition getArray(SchemaDefinition schema, Name name, boolean ignoreCase)
List<RoutineDefinition> getRoutines(SchemaDefinition schema)
List<PackageDefinition> getPackages(SchemaDefinition schema)
PackageDefinition getPackage(SchemaDefinition schema, String inputName)
void setConnection(Connection connection)
Connection getConnection()
List<String> getInputCatalogs()
List<String> getInputSchemata()
This will combine the schemata from all catalogs in a single list. If
you're working with a multi-catalog environment, you may want to call
getInputSchemata(String) instead to disambiguate schema names
(e.g. in SQL Server, there are multiple "dbo" schemas).
List<String> getInputSchemata(CatalogDefinition catalog)
List<String> getInputSchemata(String catalog)
@Deprecated String getOutputCatalog(String inputCatalog)
Definition.getOutputName()@Deprecated String getOutputSchema(String inputSchema)
Definition.getOutputName()@Deprecated String getOutputSchema(String inputCatalog, String inputSchema)
Definition.getOutputName()void setConfiguredCatalogs(List<Catalog> catalogs)
void setConfiguredSchemata(List<Schema> schemata)
void setExcludes(String[] excludes)
String[] getExcludes()
void setIncludes(String[] includes)
String[] getIncludes()
void setIncludeExcludeColumns(boolean includeExcludeColumns)
boolean getIncludeExcludeColumns()
void setIncludeForeignKeys(boolean includeForeignKeys)
boolean getIncludeForeignKeys()
void setIncludeUniqueKeys(boolean includeUniqueKeys)
boolean getIncludeUniqueKeys()
void setIncludePrimaryKeys(boolean includePrimaryKeys)
boolean getIncludePrimaryKeys()
void setIncludeIndexes(boolean includeIndexes)
boolean getIncludeIndexes()
void setIncludeSequences(boolean includeSequences)
boolean getIncludeSequences()
void setIncludeUDTs(boolean includeUDTs)
boolean getIncludeUDTs()
void setIncludePackages(boolean includePackages)
boolean getIncludePackages()
void setIncludePackageRoutines(boolean includePackageRoutines)
boolean getIncludePackageRoutines()
void setIncludePackageUDTs(boolean includePackageUDTs)
boolean getIncludePackageUDTs()
void setIncludePackageConstants(boolean includePackageConstants)
boolean getIncludePackageConstants()
void setIncludeRoutines(boolean includeRoutines)
boolean getIncludeRoutines()
void setIncludeTriggerRoutines(boolean includeTriggerRoutines)
boolean getIncludeTriggerRoutines()
void setIncludeTables(boolean includeTables)
void setForceIntegerTypesOnZeroScaleDecimals(boolean forceIntegerTypesOnZeroScaleDecimals)
boolean getForceIntegerTypesOnZeroScaleDecimals()
boolean getIncludeTables()
void addFilter(Database.Filter filter)
List<Database.Filter> getFilters()
<D extends Definition> List<D> filterExcludeInclude(List<D> definitions)
<D extends Definition> List<D> sort(List<D> definitions)
getOrderProvider() defined in this database.List<Definition> getIncluded()
List<Definition> getExcluded()
List<Definition> getAll()
void setRegexFlags(List<RegexFlag> regexFlags)
List<RegexFlag> getRegexFlags()
void setRecordVersionFields(String[] recordVersionFields)
String[] getRecordVersionFields()
void setRecordTimestampFields(String[] recordTimestampFields)
String[] getRecordTimestampFields()
void setSyntheticPrimaryKeys(String[] primaryKeys)
String[] getSyntheticPrimaryKeys()
void setOverridePrimaryKeys(String[] primaryKeys)
String[] getOverridePrimaryKeys()
void setSyntheticIdentities(String[] syntheticIdentities)
String[] getSyntheticIdentities()
@Deprecated void setConfiguredCustomTypes(List<CustomType> types)
getConfiguredForcedTypes() only.@Deprecated List<CustomType> getConfiguredCustomTypes()
getConfiguredForcedTypes() only.@Deprecated CustomType getConfiguredCustomType(String name)
getConfiguredForcedTypes() only.void setConfiguredEnumTypes(List<EnumType> types)
List<EnumType> getConfiguredEnumTypes()
void setConfiguredForcedTypes(List<ForcedType> types)
int getLogSlowQueriesAfterSeconds()
void setLogSlowQueriesAfterSeconds(int logSlowQueriesAfterSeconds)
SchemaVersionProvider getSchemaVersionProvider()
void setSchemaVersionProvider(SchemaVersionProvider provider)
CatalogVersionProvider getCatalogVersionProvider()
void setCatalogVersionProvider(CatalogVersionProvider provider)
Comparator<Definition> getOrderProvider()
void setOrderProvider(Comparator<Definition> provider)
List<ForcedType> getConfiguredForcedTypes()
ForcedType getConfiguredForcedType(Definition definition)
Definition,
or null if no ForcedType matches the definition.ForcedType getConfiguredForcedType(Definition definition, DataTypeDefinition definedType)
Definition,
or null if no ForcedType matches the definition.SQLDialect getDialect()
DSLContext create()
boolean isArrayType(String dataType)
void setSupportsUnsignedTypes(boolean supportsUnsignedTypes)
boolean supportsUnsignedTypes()
void setIgnoreProcedureReturnValues(boolean ignoreProcedureReturnValues)
boolean ignoreProcedureReturnValues()
void setDateAsTimestamp(boolean dateAsTimestamp)
boolean dateAsTimestamp()
void setIncludeRelations(boolean includeRelations)
boolean includeRelations()
void setTableValuedFunctions(boolean tableValuedFunctions)
boolean tableValuedFunctions()
boolean exists(Table<?> table)
boolean existAll(Table<?>... tables)
void setProperties(Properties properties)
These properties are typically used by database implementations like the
jooq-meta-extensions's JPADatabase (reverse-engineering
JPA-annotated entities: properties are used to describe entity lookup
paths) or the XMLDatabase (reverse-engineering an XML file:
properties are used to describe the XML file's location).
User-defined database implementations may use these properties for the same reason.
Properties getProperties()
These properties are typically used by database implementations like the
jooq-meta-extensions's JPADatabase (reverse-engineering
JPA-annotated entities: properties are used to describe entity lookup
paths) or the XMLDatabase (reverse-engineering an XML file:
properties are used to describe the XML file's location).
User-defined database implementations may use these properties for the same reason.
void close()
close in interface AutoCloseableCopyright © 2019. All rights reserved.