/** * @see org.teiid.query.sql.lang.Command#clone() * @since 5.5 */ public Object clone() { Create copy = new Create(); GroupSymbol copyTable = table.clone(); copy.setTable(copyTable); copy.columns = new ArrayList<Column>(columns.size()); for (Column column : columns) { Column copyColumn = new Column(); copyColumn.setName(column.getName()); copyColumn.setRuntimeType(column.getRuntimeType()); copyColumn.setAutoIncremented(column.isAutoIncremented()); copyColumn.setNullType(column.getNullType()); copy.columns.add(copyColumn); } copy.primaryKey = LanguageObject.Util.deepClone(primaryKey, ElementSymbol.class); copyMetadataState(copy); copy.setTableMetadata(this.tableMetadata); copy.on = this.on; copy.commitAction = this.commitAction; return copy; }
/** * @see org.teiid.query.sql.lang.Command#clone() * @since 5.5 */ public Object clone() { Create copy = new Create(); GroupSymbol copyTable = table.clone(); copy.setTable(copyTable); copy.columns = new ArrayList<Column>(columns.size()); for (Column column : columns) { Column copyColumn = new Column(); copyColumn.setName(column.getName()); copyColumn.setRuntimeType(column.getRuntimeType()); copyColumn.setAutoIncremented(column.isAutoIncremented()); copyColumn.setNullType(column.getNullType()); copy.columns.add(copyColumn); } copy.primaryKey = LanguageObject.Util.deepClone(primaryKey, ElementSymbol.class); copyMetadataState(copy); copy.setTableMetadata(this.tableMetadata); copy.on = this.on; copy.commitAction = this.commitAction; return copy; }
/** * @see org.teiid.query.sql.lang.Command#clone() * @since 5.5 */ public Object clone() { Create copy = new Create(); GroupSymbol copyTable = table.clone(); copy.setTable(copyTable); copy.columns = new ArrayList<Column>(columns.size()); for (Column column : columns) { Column copyColumn = new Column(); copyColumn.setName(column.getName()); copyColumn.setRuntimeType(column.getRuntimeType()); copyColumn.setAutoIncremented(column.isAutoIncremented()); copyColumn.setNullType(column.getNullType()); copy.columns.add(copyColumn); } copy.primaryKey = LanguageObject.Util.deepClone(primaryKey, ElementSymbol.class); copyMetadataState(copy); copy.setTableMetadata(this.tableMetadata); copy.on = this.on; copy.commitAction = this.commitAction; return copy; }
model = id(null); Create create = new Create(); create.setTableMetadata(table); create.setOn(model); {if (true) return create;}
model = id(null); Create create = new Create(); create.setTableMetadata(table); create.setOn(model); {if (true) return create;}
model = id(null); Create create = new Create(); create.setTableMetadata(table); create.setOn(model); {if (true) return create;}
@Test public void testForeignTemp() { Create create = new Create(); create.setTable(new GroupSymbol("tempTable")); //$NON-NLS-1$ create.setOn("source"); Table t = new Table(); t.setName("tempTable"); t.setUUID("tid:0"); Column c = new Column(); c.setName("x"); c.setUUID("tid:0"); Datatype string = SystemMetadata.getInstance().getRuntimeTypeMap().get("string"); c.setDatatype(string, true, 0); t.addColumn(c); c = new Column(); c.setName("y"); c.setUUID("tid:0"); Datatype decimal = SystemMetadata.getInstance().getRuntimeTypeMap().get("decimal"); c.setDatatype(decimal, true, 0); t.addColumn(c); t.setCardinality(10000); create.setTableMetadata(t); helpTest("create foreign temporary table tempTable (x string, y decimal) options (cardinality 10000) on source", "CREATE FOREIGN TEMPORARY TABLE tempTable (\n x string,\n y bigdecimal\n) OPTIONS (CARDINALITY 10000) ON 'source'", create); //$NON-NLS-1$ //$NON-NLS-2$ }