类 Table<E extends Table>

java.lang.Object
org.anyline.metadata.Metadata<E>
org.anyline.metadata.Table<E>
所有已实现的接口:
Serializable
直接已知子类:
GraphTable, Label, MasterTable, ParentTable, PartitionTable, View

public class Table<E extends Table> extends Metadata<E> implements Serializable
另请参阅:
  • 字段详细资料

    • keyword

      protected String keyword
    • inherit

      protected Table inherit
      继承自
    • master

      protected Table master
      主表(相对于分区表)
    • partition

      protected Table.Partition partition
      分区 partition by :分区方式(LIST, RANGE, HASH)及 依据列 partition of :主表 partition for:分区依据值
    • type

      protected String type
      表类型 不同数据库有所区别
    • srid

      protected int srid
      地理坐标系
    • typeCat

      protected String typeCat
    • typeSchema

      protected String typeSchema
    • typeName

      protected String typeName
    • selfReferencingColumn

      protected String selfReferencingColumn
      指定 "identifier" 列的名称
    • refGeneration

      protected String refGeneration
      指定在 SELF_REFERENCING_COL_NAME 中创建值的方式。如 SYSTEM USER DERIVED
    • engine

      protected String engine
      数据库引擎
    • charset

      protected String charset
      编码
    • collate

      protected String collate
      排序规则
    • ttl

      protected Long ttl
      数据的过期时间
    • createTime

      protected Date createTime
      创建时间
    • updateTime

      protected Date updateTime
      修改结构时间
    • dataRows

      protected Long dataRows
      数据行数
    • dataLength

      protected Long dataLength
      数据长度
    • increment

      protected Long increment
      下一个自增值
    • dataFree

      protected Long dataFree
      占用未用空间
    • indexLength

      protected Long indexLength
      索引长度
    • temporary

      protected int temporary
      是否临时表
    • metadataScan

      protected int metadataScan
    • changePrimary

      protected int changePrimary
      主键是否需要更新
    • materializes

      protected LinkedHashMap<String,View> materializes
      物化视图
    • keys

      protected List<Table.Key> keys
    • distribution

      protected Table.Distribution distribution
    • primaryKey

      protected PrimaryKey primaryKey
    • columns

      protected LinkedHashMap<String,Column> columns
    • tags

      protected LinkedHashMap<String,Tag> tags
    • indexes

      protected LinkedHashMap<String,Index> indexes
    • constraints

      protected LinkedHashMap<String,Constraint> constraints
    • sort

      protected boolean sort
    • autoDropColumn

      protected boolean autoDropColumn
  • 构造器详细资料

  • 方法详细资料

    • types

      public static Map<Integer,Type> types()
    • type

      public static Type type(int type)
    • types

      public static List<Type> types(int types)
    • from

      public static Table from(Class clazz)
    • setKeyword

      public Table setKeyword(String keyword)
    • getDistribution

      public Table.Distribution getDistribution()
    • setDistribution

      public Table setDistribution(Table.Distribution distribution)
    • setDistribution

      public Table setDistribution(Table.Distribution.TYPE type, int buckets, String... columns)
      设置分桶方式
      参数:
      type - 分桶方式
      buckets - 分桶数量
      columns - 分桶依据列
      返回:
      this
    • setDistribution

      public Table setDistribution(Table.Distribution.TYPE type, String... columns)
      设置分桶方式
      参数:
      type - 分桶方式
      columns - 分桶依据列
      返回:
      this
    • drop

      public E drop()
      覆盖:
      drop 在类中 Metadata<E extends Table>
    • getPrimaryKeySize

      public int getPrimaryKeySize()
    • getKeys

      public List<Table.Key> getKeys()
    • setKeys

      public Table setKeys(List<Table.Key> keys)
    • addKey

      public Table addKey(Table.Key key)
    • addKey

      public Table addKey(Table.Key.TYPE type, String... columns)
    • getPartition

      public Table.Partition getPartition()
    • partitionFor

      public Table partitionFor(Table.Partition.TYPE type, Object... values)
      分区依据值
      参数:
      type - 分区方式
      values - 分区依据值
      返回:
      Table
    • setPartition

      public Table setPartition(Table.Partition partition)
    • partitionBy

      public Table partitionBy(Table.Partition.TYPE type, String... columns)
    • getMasterName

      public String getMasterName()
    • setMaster

      public Table setMaster(String master)
    • getMaster

      public Table getMaster()
    • setPartitionOf

      public Table setPartitionOf(Table master)
    • setMaster

      public Table setMaster(Table master)
    • getMaterializes

      public LinkedHashMap<String,View> getMaterializes()
    • setMaterializes

      public Table setMaterializes(LinkedHashMap<String,View> materializes)
    • addMaterializes

      public Table addMaterializes(View view)
    • getMetadataScan

      public int getMetadataScan()
    • setMetadataScan

      public void setMetadataScan(int metadataScan)
    • primarys

      public LinkedHashMap<String,Column> primarys()
    • primary

      public Column primary()
    • clone

      public E clone()
      覆盖:
      clone 在类中 Metadata<E extends Table>
    • addColumn

      public Table addColumn(Column column)
    • getTtl

      public Long getTtl()
    • setTtl

      public Table setTtl(Long ttl)
    • addColumn

      public Column addColumn(String name, String type, int precision, int scale)
    • addColumn

      public Column addColumn(String name, String type, int precision)
    • addColumn

      public Column addColumn(String name, String type)
    • addColumn

      public Column addColumn(String name, TypeMetadata type)
    • addColumn

      public Column addColumn(String name, String type, boolean nullable, Object def)
    • addColumn

      public Column addColumn(String name, TypeMetadata type, boolean nullable, Object def)
    • setPrimaryKey

      public Table setPrimaryKey(String... keys)
    • setPrimaryKey

      public Table setPrimaryKey(PrimaryKey primaryKey)
    • checkColumnPrimary

      public Table checkColumnPrimary()
      检测主键
      根据主键对象,设置列主键标识
      返回:
      this
    • createPrimaryKey

      public Table createPrimaryKey()
      根据列主键标识创建主键
      返回:
      this
    • addTag

      public Table addTag(Tag tag)
    • addTag

      public Tag addTag(String name, String type)
    • addTag

      public Tag addTag(String name, String type, Object value)
    • addTag

      public Tag addTag(String name, String type, boolean nullable, Object def)
    • getName

      public String getName(boolean greedy)
    • getType

      public String getType()
    • setType

      public Table setType(String type)
    • getTypeCat

      public String getTypeCat()
    • setTypeCat

      public Table setTypeCat(String typeCat)
    • getTypeSchema

      public String getTypeSchema()
    • setTypeSchema

      public Table setTypeSchema(String typeSchema)
    • getTypeName

      public String getTypeName()
    • setTypeName

      public Table setTypeName(String typeName)
    • getSelfReferencingColumn

      public String getSelfReferencingColumn()
    • setSelfReferencingColumn

      public Table setSelfReferencingColumn(String selfReferencingColumn)
    • getRefGeneration

      public String getRefGeneration()
    • setRefGeneration

      public Table setRefGeneration(String refGeneration)
    • columns

      public List<Column> columns()
    • getColumns

      public LinkedHashMap<String,Column> getColumns()
    • getColumns

      public List<String> getColumns(boolean name)
      列名s
      参数:
      name - 是否只获取列表
      返回:
      List
    • setColumns

      public <T extends Column> Table setColumns(LinkedHashMap<String,T> columns)
    • tags

      public List<Tag> tags()
    • getTags

      public LinkedHashMap<String,Tag> getTags()
    • setTags

      public Table setTags(LinkedHashMap<String,Tag> tags)
    • getIndex

      public Index getIndex(String name)
    • getIndexes

      public <T extends Index> LinkedHashMap<String,T> getIndexes()
    • getPrimaryKeyColumns

      public LinkedHashMap<String,Column> getPrimaryKeyColumns()
    • getPrimaryKey

      public PrimaryKey getPrimaryKey()
    • getChangePrimary

      public int getChangePrimary()
    • setChangePrimary

      public void setChangePrimary(int changePrimary)
    • setIndexes

      public <T extends Index> Table setIndexes(LinkedHashMap<String,T> indexes)
    • add

      public Table add(Index index)
    • add

      public Table add(Constraint constraint)
    • getConstraints

      public <T extends Constraint> LinkedHashMap<String,T> getConstraints()
    • setConstraints

      public Table setConstraints(LinkedHashMap<String,Constraint> constraints)
    • getColumn

      public Column getColumn(String name)
    • getTag

      public Column getTag(String name)
    • getEngine

      public String getEngine()
    • setEngine

      public Table setEngine(String engine)
    • getCharset

      public String getCharset()
    • setCharset

      public Table setCharset(String charset)
    • getCollate

      public String getCollate()
    • setCollate

      public Table setCollate(String collate)
    • getSrid

      public int getSrid()
    • setSrid

      public Table setSrid(int srid)
    • getDataFree

      public Long getDataFree()
    • setDataFree

      public Table setDataFree(Long dataFree)
    • getEngineParameters

      public String getEngineParameters()
    • setEngineParameters

      public Table setEngineParameters(String engineParameters)
    • getInherit

      public Table getInherit()
    • setInherit

      public Table setInherit(Table inherit)
    • setInherit

      public Table setInherit(String setInherit)
    • getKeyword

      public String getKeyword()
      覆盖:
      getKeyword 在类中 Metadata<E extends Table>
    • isAutoDropColumn

      public boolean isAutoDropColumn()
    • setAutoDropColumn

      public Table setAutoDropColumn(boolean autoDropColumn)
    • getCreateTime

      public Date getCreateTime()
    • setCreateTime

      public Table setCreateTime(Date createTime)
    • getUpdateTime

      public Date getUpdateTime()
    • setUpdateTime

      public Table setUpdateTime(Date updateTime)
    • getDataRows

      public Long getDataRows()
    • setDataRows

      public Table setDataRows(Long dataRows)
    • getDataLength

      public Long getDataLength()
    • getTemporary

      public int getTemporary()
    • isTemporary

      public boolean isTemporary()
    • setTemporary

      public Table setTemporary(int temporary)
    • setTemporary

      public Table setTemporary(boolean temporary)
    • setDataLength

      public Table setDataLength(Long dataLength)
    • getIncrement

      public Long getIncrement()
    • setIncrement

      public Table setIncrement(Long increment)
    • getIndexLength

      public Long getIndexLength()
    • setIndexLength

      public Table setIndexLength(Long indexLength)
    • isSort

      public boolean isSort()
    • setSort

      public Table setSort(boolean sort)
    • sort

      public Table sort(boolean nullFirst)
      列排序
      参数:
      nullFirst - 未设置位置(setPosition)的列是否排在最前
      返回:
      Table
    • sort

      public Table sort()
    • toString

      public String toString()
      覆盖:
      toString 在类中 Metadata<E extends Table>
    • equals

      public boolean equals(Table table)
    • equals

      public boolean equals(Table table, boolean ignoreCase)
    • equals

      public boolean equals(Table table, boolean ignoreCase, boolean ignoreSchema)
    • primaryEquals

      public boolean primaryEquals(Table table)
      主键相同
      参数:
      table - table
      返回:
      boolean
    • compare

      public TableDiffer compare(Table table)