Table implements TableReference, Segment { public Column[] allColumns() { return columns.values().toArray(new Column[]{}); } Table(String name);  Table(String name, String alias); Table inShard(String shardId); Table shardBy(String shardValue); Table as(String alias); @Override String getName(); String getAlias(); @Override String getShardId(); @Override String getShardValue(); String getReferName(BuilderContext helper); @Override String build(BuilderContext helper); Column[] allColumns(); Column column(String name, JDBCType type); @Override String toString(); Column bitColumn(String name); Column tinyintColumn(String name); Column smallintColumn(String name); Column integerColumn(String name); Column bigintColumn(String name); Column floatColumn(String name); Column realColumn(String name); Column doubleColumn(String name); Column numericColumn(String name); Column decimalColumn(String name); Column charColumn(String name); Column varcharColumn(String name); Column longvarcharColumn(String name); Column dateColumn(String name); Column timeColumn(String name); Column timestampColumn(String name); Column binaryColumn(String name); Column varbinaryColumn(String name); Column longvarbinaryColumn(String name); Column nullColumn(String name); Column blobColumn(String name); Column clobColumn(String name); Column booleanColumn(String name); Column ncharColumn(String name); Column nvarcharColumn(String name); Column longnvarcharColumn(String name); Column nclobColumn(String name); Column sqlxmlColumn(String name); Column timeWithTimezoneColumn(String name); Column timestampWithTimezoneColumn(String name);  }
@Test public void testAllColumns() { Table table = new Table("t").as("ali"); table.bigintColumn("aaa"); table.charColumn("bbb"); Column[] all = table.allColumns(); assertEquals("aaa", all[0].getColumnName()); assertEquals(JDBCType.BIGINT, all[0].getType()); assertEquals("bbb", all[1].getColumnName()); assertEquals(JDBCType.CHAR, all[1].getType()); }