Class SchemaDef


  • @Immutable
    public class SchemaDef
    extends Object
    Database schema definition.

    Contains database table definitions.

    Never interacts directly with databases, only provides with SQL commands (possible with macros for SQLDialect).

    Value object.

    See Also:
    SchemaDefBuilder, TableDef
    • Method Detail

      • getDomains

        @NotNull
        public com.google.common.collect.ImmutableList<DomainDef> getDomains()
        Returns a list of all domain.
        Returns:
        list of all domains in definition order.
        Since:
        9.0
        See Also:
        getDomain(java.lang.String)
      • getAllTables

        @NotNull
        public List<TableDef> getAllTables()
        Returns all table definitions.
        Returns:
        an immutable list of table definitions in source order.
      • getAllTableNamesSet

        @NotNull
        public NavigableSet<String> getAllTableNamesSet()
        Names of all tables as a set.
        Returns:
        a live view to the case-insensitive set of all tables (with no order).
        Since:
        8.1
      • getTables

        @NotNull
        public List<TableDef> getTables​(boolean includePermanent,
                                        boolean includeTemporary)
        Returns all permanent table definitions.
        Returns:
        a list of table definitions in source order. This list can be immutable but can be not (don't assume).
      • getDomainFields

        @NotNull
        public Map<TableDef,​List<TableFieldDef>> getDomainFields​(@NotNull
                                                                       DomainDef domain)
        Lists fields of tables that relate to the specified domain.
        Parameters:
        domain - domain.
        Returns:
        pairs of (table,field).
        Since:
        9.0
      • subschema

        @NotNull
        public SchemaDef subschema​(String... tableNames)