private static Column readColumn(DatabaseMetaDataWrapper metaData, Map<String, Object> values) throws SQLException { Column column = new Column();
Column column = new Column();
private Column createTagColumn(String tagName){ Column tagColumn = new Column(); tagColumn.setName(tagName); tagColumn.setTypeCode(Types.VARCHAR); tagColumn.setJavaName(tagName); // tagColumn.setScale(1024); tagColumn.setSize(String.valueOf(JdbcConstants.DEFAULT_FIELD_VARCHAR_SIZE)); tagColumn.setDefaultValue(null); tagColumn.setDescription("eagle entity tag column for "+tagName); return tagColumn; }
private Column createTagColumn(String tagName){ Column tagColumn = new Column(); tagColumn.setName(tagName); tagColumn.setTypeCode(Types.VARCHAR); tagColumn.setJavaName(tagName); // tagColumn.setScale(1024); tagColumn.setSize(String.valueOf(JdbcConstants.DEFAULT_TAG_VARCHAR_SIZE)); tagColumn.setDefaultValue(null); tagColumn.setDescription("eagle entity tag column for "+tagName); return tagColumn; }
private void buildTable(Table table) { Column id = new Column(); id.setName("id"); id.setPrimaryKey(true); id.setRequired(true); id.setTypeCode(Types.VARCHAR); id.setSize("50"); table.addColumn(id); Column value = new Column(); value.setName("value"); value.setTypeCode(Types.CLOB); table.addColumn(value); } }
private static Column generateOneColumn(DatabaseMetaDataWrapper metaData, Map<String, Object> values) throws SQLException { Column column = new Column();
private static Column readColumn(DatabaseMetaDataWrapper metaData, Map<String, Object> values) throws SQLException { Column column = new Column();
Column metricColumn = new Column(); metricColumn.setName(JdbcConstants.METRIC_NAME_COLUMN_NAME); metricColumn.setTypeCode(Types.VARCHAR); Column pkColumn = new Column(); pkColumn.setName(JdbcConstants.ROW_KEY_COLUMN_NAME); pkColumn.setPrimaryKey(true); Column tsColumn = new Column(); tsColumn.setName(JdbcConstants.TIMESTAMP_COLUMN_NAME); tsColumn.setTypeCode(Types.BIGINT); Column fieldColumn = new Column(); fieldColumn.setName(entry.getKey()); fieldColumn.setJavaName(entry.getKey());
Column metricColumn = new Column(); metricColumn.setName(JdbcConstants.METRIC_NAME_COLUMN_NAME); metricColumn.setTypeCode(Types.VARCHAR); Column pkColumn = new Column(); pkColumn.setName(JdbcConstants.ROW_KEY_COLUMN_NAME); pkColumn.setPrimaryKey(true); Column tsColumn = new Column(); tsColumn.setName(JdbcConstants.TIMESTAMP_COLUMN_NAME); tsColumn.setTypeCode(Types.BIGINT); Column fieldColumn = new Column(); fieldColumn.setName(entry.getKey()); fieldColumn.setJavaName(entry.getKey());
Column column = new Column();
@Test public void testTable(){ Table table = new Table(); Column column = new Column(); column.setName("id"); column.setDefaultValue("-1"); column.setDescription("rowkey"); column.setPrimaryKey(true); column.setType(TypeMap.VARCHAR); table.addColumn(column); table.setName("eagle_table"); System.out.println(table.toString()); } }
/** * Returns a clone of the given source column. * * @param source The source column * @param clonePrimaryKeyStatus Whether to clone the column's primary key status; if <code>false</code> * then the clone will not be a primary key column * @return The clone */ public Column clone(Column source, boolean clonePrimaryKeyStatus) { Column result = new Column(); result.setName(source.getName()); result.setJavaName(source.getJavaName()); result.setPrimaryKey(clonePrimaryKeyStatus ? source.isPrimaryKey() : false); result.setRequired(source.isRequired()); result.setAutoIncrement(source.isAutoIncrement()); result.setTypeCode(source.getTypeCode()); result.setSize(source.getSize()); result.setDefaultValue(source.getDefaultValue()); return result; }