Column extends AbstractColumn implements Segment { public Column as(String alias) { if(this.alias.isPresent()) { throw new IllegalStateException("Alias can only be set once for column" + getColumnName()); } this.alias = Optional.of(alias); return this; } Column(Table table, String name, JDBCType type); Column as(String alias); @Override Optional<String> getAlias(); @Override String getTableName(BuilderContext helper); Table getTable();  }
@Test public void testReferenceName( ) { Table table = new Table("t"); Column c = new Column(table, "col", JDBCType.VARBINARY); c.as("c"); assertEquals("t.col", c.getReference(new DefaultBuilderContext())); }