Class TableDefinition

java.lang.Object
org.apache.ignite.catalog.definitions.TableDefinition

public class TableDefinition extends Object
Definition of the CREATE TABLE statement.
  • Method Details

    • builder

      public static TableDefinition.Builder builder(String tableName)
      Creates a builder for the table with the specified name.
      Parameters:
      tableName - Table name.
      Returns:
      Builder.
    • tableName

      public String tableName()
      Returns table name.
      Returns:
      Table name.
    • schemaName

      @Nullable public @Nullable String schemaName()
      Returns schema name.
      Returns:
      Schema name or null if not specified.
    • ifNotExists

      public boolean ifNotExists()
      Returns not exists flag.
      Returns:
      true if IF NOT EXISTS clause should be added to the statement.
    • columns

      @Nullable public @Nullable List<ColumnDefinition> columns()
      Returns definitions of the columns.
      Returns:
      List of column definitions or null if columns are specified using other methods.
      See Also:
    • primaryKeyType

      @Nullable public @Nullable IndexType primaryKeyType()
      Returns primary key type.
      Returns:
      Primary key type or null if default should be used.
    • primaryKeyColumns

      @Nullable public @Nullable List<ColumnSorted> primaryKeyColumns()
      Returns a list of columns used in the primary key.
      Returns:
      List of columns used in the primary key or null if the primary key is not specified.
    • zoneName

      @Nullable public @Nullable String zoneName()
      Returns primary zone name.
      Returns:
      Zone name to use in the ZONE option or null if not specified.
    • colocationColumns

      public List<String> colocationColumns()
      Returns a list of colocation column names.
      Returns:
      A list of colocation column names, or null if not specified.
    • keyClass

      @Nullable public @Nullable Class<?> keyClass()
      Returns a class to use to generate columns. If it's a natively supported class, then the column with the name "id" will be created and added to the list of columns for the primary key. If it's a class annotated with the Table annotation, then the annotation will be processed and column definitions will be extracted from it.
      Returns:
      A class to use to generate columns or null if columns are specified using other methods.
      See Also:
    • valueClass

      @Nullable public @Nullable Class<?> valueClass()
      Returns a class to use to generate columns. If it's a natively supported class, then the column with the name "val" will be created. If it's a class annotated with the Table annotation, then the annotation will be processed and column definitions will be extracted from it.
      Returns:
      A class to use to generate columns or null if columns are specified using other methods.
      See Also:
    • indexes

      @Nullable public @Nullable List<IndexDefinition> indexes()
      Returns a list of indexes to create on this table.
      Returns:
      a list of index definitions to create on this table or null if none should be created.
    • toBuilder

      public TableDefinition.Builder toBuilder()
      Returns new builder using this definition.
      Returns:
      New builder.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object