Package org.jooq.meta

Interface Database

    • Method Detail

      • getSources

        Map<Definition,​String> getSources()
        Get the sources for all objects that offer sources.
      • getRelations

        Relations getRelations()
        Retrieve the schema's primary key / foreign key relations.
      • setConnection

        void setConnection​(Connection connection)
        Initialise a connection to this database.
      • getConnection

        Connection getConnection()
        The database connection.
      • getInputCatalogs

        List<String> getInputCatalogs()
        The input catalogs are the catalogs that jooq-meta is reading data from.
      • getInputSchemata

        List<String> getInputSchemata()
        The input schemata are the schemata from all catalogs that jooq-meta is reading data from.

        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).

      • getInputSchemata

        List<String> getInputSchemata​(CatalogDefinition catalog)
        The input schemata are the schemata from a given catalog that jooq-meta is reading data from.
      • getInputSchemata

        List<String> getInputSchemata​(String catalog)
        The input schemata are the schemata from a given catalog that jooq-meta is reading data from.
      • setConfiguredCatalogs

        void setConfiguredCatalogs​(List<CatalogMappingType> catalogs)
        The input and output catalogs.
      • setConfiguredSchemata

        void setConfiguredSchemata​(List<SchemaMappingType> schemata)
        The input and output schemata.
      • setExcludes

        void setExcludes​(String[] excludes)
        Database objects matching any of these regular expressions will not be generated.
      • getExcludes

        String[] getExcludes()
        Database objects matching any of these regular expressions will not be generated.
      • setIncludes

        void setIncludes​(String[] includes)
        Only database objects matching any of these regular expressions will be generated.
      • getIncludes

        String[] getIncludes()
        Only database objects matching any of these regular expressions will be generated.
      • setIncludeExcludeColumns

        void setIncludeExcludeColumns​(boolean includeExcludeColumns)
        Indicate whether include / exclude regular expression shall also match database columns.
      • getIncludeExcludeColumns

        boolean getIncludeExcludeColumns()
        Indicate whether include / exclude regular expression shall also match database columns.
      • setIncludeExcludePackageRoutines

        void setIncludeExcludePackageRoutines​(boolean includeExcludePackageRoutines)
        Indicate whether include / exclude regular expression shall also match package routines.
      • getIncludeExcludePackageRoutines

        boolean getIncludeExcludePackageRoutines()
        Indicate whether include / exclude regular expression shall also match package routines.
      • setIncludeForeignKeys

        void setIncludeForeignKeys​(boolean includeForeignKeys)
        whether foreign key relationships should be included.
      • getIncludeForeignKeys

        boolean getIncludeForeignKeys()
        whether foreign key relationships should be included.
      • setIncludeUniqueKeys

        void setIncludeUniqueKeys​(boolean includeUniqueKeys)
        whether unique keys should be included.
      • getIncludeUniqueKeys

        boolean getIncludeUniqueKeys()
        whether unique keys should be included.
      • setIncludePrimaryKeys

        void setIncludePrimaryKeys​(boolean includePrimaryKeys)
        whether primary keys should be included.
      • getIncludePrimaryKeys

        boolean getIncludePrimaryKeys()
        whether primary keys should be included.
      • setIncludeCheckConstraints

        void setIncludeCheckConstraints​(boolean checkConstraints)
        whether check constraints should be included.
      • getIncludeCheckConstraints

        boolean getIncludeCheckConstraints()
        whether check constraints should be included.
      • setIncludeSystemTables

        void setIncludeSystemTables​(boolean systemTables)
        whether system generated tables should be included.
      • getIncludeSystemTables

        boolean getIncludeSystemTables()
        whether system generated tables should be included.
      • setIncludeSystemIndexes

        void setIncludeSystemIndexes​(boolean systemIndexes)
        whether system generated indexes should be included.
      • getIncludeSystemIndexes

        boolean getIncludeSystemIndexes()
        whether system generated indexes should be included.
      • setIncludeSystemCheckConstraints

        void setIncludeSystemCheckConstraints​(boolean systemCheckConstraints)
        whether system generated check constraints should be included.
      • getIncludeSystemCheckConstraints

        boolean getIncludeSystemCheckConstraints()
        whether system generated check constraints should be included.
      • setIncludeSystemSequences

        void setIncludeSystemSequences​(boolean systemSequences)
        whether system generated sequences should be included.
      • getIncludeSystemSequences

        boolean getIncludeSystemSequences()
        whether system generated sequences should be included.
      • setIncludeSystemUDTs

        void setIncludeSystemUDTs​(boolean systemUDTs)
        whether system generated UDTs should be included.
      • getIncludeSystemUDTs

        boolean getIncludeSystemUDTs()
        whether system generated UDTs should be included.
      • setIncludeIndexes

        void setIncludeIndexes​(boolean includeIndexes)
        whether indexes should be included.
      • getIncludeIndexes

        boolean getIncludeIndexes()
        whether indexes should be included.
      • setIncludeDomains

        void setIncludeDomains​(boolean includeDomains)
        whether domains should be included.
      • getIncludeDomains

        boolean getIncludeDomains()
        whether domains should be included.
      • setIncludeSequences

        void setIncludeSequences​(boolean includeSequences)
        whether sequences should be included.
      • getIncludeSequences

        boolean getIncludeSequences()
        whether sequences should be included.
      • setIncludeUDTs

        void setIncludeUDTs​(boolean includeUDTs)
        whether user defined types should be included.
      • getIncludeUDTs

        boolean getIncludeUDTs()
        whether user defined types should be included.
      • setIncludePackages

        void setIncludePackages​(boolean includePackages)
        whether packages should be included.
      • getIncludePackages

        boolean getIncludePackages()
        whether packages should be included.
      • setIncludePackageRoutines

        void setIncludePackageRoutines​(boolean includePackageRoutines)
        whether package routines should be included.
      • getIncludePackageRoutines

        boolean getIncludePackageRoutines()
        whether package routines should be included.
      • setIncludePackageUDTs

        void setIncludePackageUDTs​(boolean includePackageUDTs)
        whether package UDTs should be included.
      • getIncludePackageUDTs

        boolean getIncludePackageUDTs()
        whether package UDTs should be included.
      • setIncludePackageConstants

        void setIncludePackageConstants​(boolean includePackageConstants)
        whether package constants should be included.
      • getIncludePackageConstants

        boolean getIncludePackageConstants()
        whether package constants should be included.
      • setIncludeRoutines

        void setIncludeRoutines​(boolean includeRoutines)
        whether routines should be included.
      • getIncludeRoutines

        boolean getIncludeRoutines()
        whether routines should be included.
      • setIncludeTriggerRoutines

        void setIncludeTriggerRoutines​(boolean includeTriggerRoutines)
        whether trigger routines should be included.
      • getIncludeTriggerRoutines

        boolean getIncludeTriggerRoutines()
        whether trigger routines should be included.
      • setIncludeTables

        void setIncludeTables​(boolean includeTables)
        Whether tables (and views) should be included.
      • getIncludeTables

        boolean getIncludeTables()
        Whether tables (and views) should be included.
      • setIncludeEmbeddables

        void setIncludeEmbeddables​(boolean includeEmbeddables)
        Whether embeddable types should be included.
      • getIncludeEmbeddables

        boolean getIncludeEmbeddables()
        Whether embeddable types should be included.
      • setIncludeInvisibleColumns

        void setIncludeInvisibleColumns​(boolean includeInvisibleColumns)
        Whether invisible columns should be included.
      • getIncludeInvisibleColumns

        boolean getIncludeInvisibleColumns()
        Whether invisible columns should be included.
      • setForceIntegerTypesOnZeroScaleDecimals

        void setForceIntegerTypesOnZeroScaleDecimals​(boolean forceIntegerTypesOnZeroScaleDecimals)
        Whether zero-scale decimal types should be treated as their most appropriate, corresponding integer type.
      • getForceIntegerTypesOnZeroScaleDecimals

        boolean getForceIntegerTypesOnZeroScaleDecimals()
        Whether zero-scale decimal types should be treated as their most appropriate, corresponding integer type.
      • setOnError

        void setOnError​(OnError onError)
        The behaviour when errors are encountered.
      • onError

        OnError onError()
        The behaviour when errors are encountered.
      • addFilter

        void addFilter​(Database.Filter filter)
        [#3488] Add an additional filter to the database that is applied in addition to include / exclude.
      • getFilters

        List<Database.Filter> getFilters()
        [#3488] The filters that are applied in addition to include / exclude.
      • filterExcludeInclude

        <D extends DefinitionList<D> filterExcludeInclude​(List<D> definitions)
        Filter a list of definitions according to the exclude / include / and filter settings of this database.
      • getIncluded

        List<Definition> getIncluded()
        Retrieve all included objects.
      • getExcluded

        List<Definition> getExcluded()
        Retrieve all excluded objects.
      • setRegexFlags

        void setRegexFlags​(List<RegexFlag> regexFlags)
        The regular expression flags that should be applied when using regular expressions.
      • getRegexFlags

        List<RegexFlag> getRegexFlags()
        The regular expression flags that should be applied when using regular expressions.
      • setRegexMatchesPartialQualification

        void setRegexMatchesPartialQualification​(boolean regexMatchesPartialQualification)
        Whether the regular expressions matching database objects should match partially qualified names as well as fully qualified and unqualified names.
      • getRegexMatchesPartialQualification

        boolean getRegexMatchesPartialQualification()
        Whether the regular expressions matching database objects should match partially qualified names as well as fully qualified and unqualified names.
      • setSqlMatchesPartialQualification

        void setSqlMatchesPartialQualification​(boolean sqlMatchesPartialQualification)
        Whether the SQL statements matching database objects should match partially qualified names as well as fully qualified and unqualified names.
      • getSqlMatchesPartialQualification

        boolean getSqlMatchesPartialQualification()
        Whether the SQL statements matching database objects should match partially qualified names as well as fully qualified and unqualified names.
      • setRecordVersionFields

        void setRecordVersionFields​(String[] recordVersionFields)
        Table columns matching these regular expressions will be considered as record version fields in generated code.
      • getRecordVersionFields

        String[] getRecordVersionFields()
        Table columns matching these regular expressions will be considered as record version fields in generated code.
      • setRecordTimestampFields

        void setRecordTimestampFields​(String[] recordTimestampFields)
        Table columns matching these regular expressions will be considered as record timestamp fields in generated code.
      • getRecordTimestampFields

        String[] getRecordTimestampFields()
        Table columns matching these regular expressions will be considered as record timestamp fields in generated code.
      • setSyntheticPrimaryKeys

        @Deprecated
        void setSyntheticPrimaryKeys​(String[] primaryKeys)
        Deprecated.
        - 3.14.0 - [#10588] - Use #setConfiguredSyntheticKeys(SyntheticKeysType) instead.
        Columns matching these regular expressions will be considered as members of synthetic primary keys in generated code.
      • getSyntheticPrimaryKeys

        @Deprecated
        String[] getSyntheticPrimaryKeys()
        Deprecated.
        - 3.14.0 - [#10588] - Use getConfiguredSyntheticPrimaryKeys() instead.
        Columns matching these regular expressions will be considered as members of synthetic primary keys in generated code.
      • setOverridePrimaryKeys

        @Deprecated
        void setOverridePrimaryKeys​(String[] primaryKeys)
        Deprecated.
        - 3.14.0 - [#10588] - Use #setConfiguredSyntheticKeys(SyntheticKeysType) instead.
        Unique keys matching these regular expressions will be considered as primary keys in generated code.
      • setSyntheticIdentities

        @Deprecated
        void setSyntheticIdentities​(String[] syntheticIdentities)
        Deprecated.
        - 3.14.0 - [#10588] - Use #setConfiguredSyntheticKeys(SyntheticKeysType) instead.
        Columns matching these regular expressions will be considered as identity columns in generated code.
      • setConfiguredEnumTypes

        void setConfiguredEnumTypes​(List<EnumType> types)
        Database objects matching any of these field names will be generated as enum types.
      • getConfiguredEnumTypes

        List<EnumType> getConfiguredEnumTypes()
        Database objects matching any of these field names will be generated as enum types.
      • setConfiguredForcedTypes

        void setConfiguredForcedTypes​(List<ForcedType> types)
        Database objects matching any of these field names will be generated as forced types.
      • getLogSlowQueriesAfterSeconds

        int getLogSlowQueriesAfterSeconds()
        Log slow queries after this amount of seconds.
      • setLogSlowQueriesAfterSeconds

        void setLogSlowQueriesAfterSeconds​(int logSlowQueriesAfterSeconds)
        Log slow queries after this amount of seconds.
      • getLogSlowResultsAfterSeconds

        int getLogSlowResultsAfterSeconds()
        Log slow results after this amount of seconds.
      • setLogSlowResultsAfterSeconds

        void setLogSlowResultsAfterSeconds​(int logSlowResultsAfterSeconds)
        Log slow results after this amount of seconds.
      • getSchemaVersionProvider

        SchemaVersionProvider getSchemaVersionProvider()
        The database's schema version provider.
      • setSchemaVersionProvider

        void setSchemaVersionProvider​(SchemaVersionProvider provider)
        The database's schema version provider.
      • getCatalogVersionProvider

        CatalogVersionProvider getCatalogVersionProvider()
        The database's catalog version provider.
      • setCatalogVersionProvider

        void setCatalogVersionProvider​(CatalogVersionProvider provider)
        The database's catalog version provider.
      • setOrderProvider

        void setOrderProvider​(Comparator<Definition> provider)
        The database's order provider.
      • markUsed

        void markUsed​(ForcedType forcedType)
        Mark a forced type as used.
      • getUnusedForcedTypes

        List<ForcedType> getUnusedForcedTypes()
        Retrieve the not-yet used forced types.
      • getConfiguredForcedTypes

        List<ForcedType> getConfiguredForcedTypes()
        Database objects matching any of these field names will be generated as forced types.
      • getConfiguredForcedType

        ForcedType getConfiguredForcedType​(Definition definition)
        Get the configured forced type object for any given Definition, or null if no ForcedType matches the definition.
      • setConfiguredEmbeddables

        void setConfiguredEmbeddables​(List<EmbeddableDefinitionType> configuredEmbeddables)
        Configure the embeddable types.
      • embeddablePrimaryKeys

        String embeddablePrimaryKeys()
        A regular expression matching primary keys for which embeddable types should be generated.
      • setEmbeddablePrimaryKeys

        void setEmbeddablePrimaryKeys​(String embeddablePrimaryKeys)
        A regular expression matching primary keys for which embeddable types should be generated.
      • embeddableUniqueKeys

        String embeddableUniqueKeys()
        A regular expression matching unique keys for which embeddable types should be generated.
      • setEmbeddableUniqueKeys

        void setEmbeddableUniqueKeys​(String embeddableUniqueKeys)
        A regular expression matching unique keys for which embeddable types should be generated.
      • embeddableDomains

        String embeddableDomains()
        A regular expression matching domain type definitions for which embeddable types should be generated.
      • setEmbeddableDomains

        void setEmbeddableDomains​(String embeddableDomains)
        A regular expression matching domain type definitions for which embeddable types should be generated.
      • setConfiguredComments

        void setConfiguredComments​(List<CommentType> configuredComments)
        Configure the comments.
      • getConfiguredComments

        List<CommentType> getConfiguredComments()
        Get the configured comments.
      • markUsed

        void markUsed​(CommentType comment)
        Mark a comment as used.
      • getUnusedComments

        List<CommentType> getUnusedComments()
        Retrieve the not-yet used comments.
      • setConfiguredSyntheticObjects

        void setConfiguredSyntheticObjects​(SyntheticObjectsType configuredSyntheticObjects)
        Configure the synthetic objects.
      • getConfiguredSyntheticIdentities

        List<SyntheticIdentityType> getConfiguredSyntheticIdentities()
        Get the configured synthetic identities.
      • getConfiguredSyntheticPrimaryKeys

        List<SyntheticPrimaryKeyType> getConfiguredSyntheticPrimaryKeys()
        Get the configured synthetic primary keys.
      • getConfiguredSyntheticUniqueKeys

        List<SyntheticUniqueKeyType> getConfiguredSyntheticUniqueKeys()
        Get the configured synthetic unique keys.
      • getConfiguredSyntheticForeignKeys

        List<SyntheticForeignKeyType> getConfiguredSyntheticForeignKeys()
        Get the configured synthetic foreign keys.
      • getConfiguredSyntheticViews

        List<SyntheticViewType> getConfiguredSyntheticViews()
        Get the configured synthetic views.
      • getUnusedSyntheticIdentities

        List<SyntheticIdentityType> getUnusedSyntheticIdentities()
        Retrieve the not-yet used synthetic identities.
      • getUnusedSyntheticPrimaryKeys

        List<SyntheticPrimaryKeyType> getUnusedSyntheticPrimaryKeys()
        Retrieve the not-yet used synthetic primary keys.
      • getUnusedSyntheticUniqueKeys

        List<SyntheticUniqueKeyType> getUnusedSyntheticUniqueKeys()
        Retrieve the not-yet used synthetic unique keys.
      • getUnusedSyntheticForeignKeys

        List<SyntheticForeignKeyType> getUnusedSyntheticForeignKeys()
        Retrieve the not-yet used synthetic foreign keys.
      • getUnusedSyntheticViews

        List<SyntheticViewType> getUnusedSyntheticViews()
        Retrieve the not-yet used synthetic views.
      • getDialect

        SQLDialect getDialect()
        Get the dialect for this database.
      • setDialect

        void setDialect​(SQLDialect dialect)
        Set the dialect for this database.
      • create

        DSLContext create()
        Create the factory for this database.
      • isArrayType

        boolean isArrayType​(String dataType)
        Check whether a type is an array type.
      • setSupportsUnsignedTypes

        void setSupportsUnsignedTypes​(boolean supportsUnsignedTypes)
        Whether this database supports unsigned types.
      • supportsUnsignedTypes

        boolean supportsUnsignedTypes()
        Whether this database supports unsigned types.
      • setIntegerDisplayWidths

        void setIntegerDisplayWidths​(boolean integerDisplayWidths)
        Whether this database includes integer display widths in metadata, where applicable.
      • integerDisplayWidths

        boolean integerDisplayWidths()
        Whether this database includes integer display widths in metadata, where applicable.
      • setIgnoreProcedureReturnValues

        void setIgnoreProcedureReturnValues​(boolean ignoreProcedureReturnValues)
        Whether this database should ignore procedure return values.
      • ignoreProcedureReturnValues

        boolean ignoreProcedureReturnValues()
        Whether this database should ignore procedure return values.
      • setDateAsTimestamp

        void setDateAsTimestamp​(boolean dateAsTimestamp)
        Whether DATE columns should be treated as TIMESTAMP columns.
      • dateAsTimestamp

        boolean dateAsTimestamp()
        Whether DATE columns should be treated as TIMESTAMP columns.
      • setJavaTimeTypes

        void setJavaTimeTypes​(boolean javaTimeTypes)
        Whether java.time types are used, as opposed to java.sql types.
      • javaTimeTypes

        boolean javaTimeTypes()
        Whether java.time types are used, as opposed to java.sql types.
      • setIncludeRelations

        void setIncludeRelations​(boolean includeRelations)
        [#3559] Whether relations (i.e. constraints) should be included in this database.
      • includeRelations

        boolean includeRelations()
        [#3559] Whether relations (i.e. constraints) should be included in this database.
      • setTableValuedFunctions

        void setTableValuedFunctions​(boolean tableValuedFunctions)
        [#4838] Whether table-valued functions should be reported as tables.
      • tableValuedFunctions

        boolean tableValuedFunctions()
        [#4838] Whether table-valued functions should be reported as tables.
      • exists

        boolean exists​(TableField<?,​?> field)
        Check for the existence of a table field in the dictionary views.
      • existAll

        boolean existAll​(TableField<?,​?>... fields)
        Check for the existence of several table fields in the dictionary views.
      • exists

        boolean exists​(Table<?> table)
        Check for the existence of a table in the dictionary views.
      • existAll

        boolean existAll​(Table<?>... tables)
        Check for the existence of several tables in the dictionary views.
      • setProperties

        void setProperties​(Properties properties)
        Database 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.

      • getProperties

        Properties getProperties()
        Database 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.

      • setBasedir

        void setBasedir​(String basedir)
        The basedir that can be used by file based implementations to resolve relative paths.
      • getBasedir

        String getBasedir()
        The basedir that can be used by file based implementations to resolve relative paths.
      • close

        void close()
        Release any resources that this Database may have allocated.
        Specified by:
        close in interface AutoCloseable