Class SchemaDef
- java.lang.Object
-
- jetbrains.buildServer.serverSide.db.schema.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 Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String[]getAllTableNames()Names of all tables as an array.NavigableSet<String>getAllTableNamesSet()Names of all tables as a set.List<TableDef>getAllTables()Returns all table definitions.DomainDefgetDomain(String name)Returns domain by name.Map<TableDef,List<TableFieldDef>>getDomainFields(DomainDef domain)Lists fields of tables that relate to the specified domain.com.google.common.collect.ImmutableList<DomainDef>getDomains()Returns a list of all domain.List<String>getPermanentTableNames()Names of permanent tables.TableDefgetTable(String name)List<TableDef>getTables(boolean includePermanent, boolean includeTemporary)Returns all permanent table definitions.List<String>getTemporaryTableNames()Names of temporary tables.SchemaDefsubschema(String... tableNames)
-
-
-
Method Detail
-
getDomain
@NotNull public DomainDef getDomain(@NotNull String name) throws UnknownDomainException
Returns domain by name.- Parameters:
name- name of an existent domain.- Returns:
- the domain.
- Throws:
UnknownDomainException- when no such domain in the schema.- Since:
- 9.0
- See Also:
getDomains()
-
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.
-
getAllTableNames
@NotNull public String[] getAllTableNames()
Names of all tables as an array.- Returns:
- a copy of all tables names array, with the original order.
- See Also:
getAllTableNamesSet(),getPermanentTableNames(),getTemporaryTableNames()
-
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
-
getPermanentTableNames
@NotNull public List<String> getPermanentTableNames()
Names of permanent tables.- Returns:
- list of names of permanent tables, with order like in the source file.
- See Also:
getAllTableNames(),getPermanentTableNames()
-
getTemporaryTableNames
@NotNull public List<String> getTemporaryTableNames()
Names of temporary tables.- Returns:
- list of names of temporary tables, with order like in the source file.
- Since:
- 8.1
- See Also:
getAllTableNames(),getPermanentTableNames()
-
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
-
-