public void testUpdatingModelCount() { DynamicCommand sqlCmd = new DynamicCommand(); sqlCmd.setUpdatingModelCount(1); assertEquals(1, sqlCmd.getUpdatingModelCount()); sqlCmd.setUpdatingModelCount(3); assertEquals(2, sqlCmd.getUpdatingModelCount()); sqlCmd.setUpdatingModelCount(-1); assertEquals(0, sqlCmd.getUpdatingModelCount()); }
@Test public void testDynamicCommandStatement1() throws Exception { List<ElementSymbol> symbols = new ArrayList<ElementSymbol>(); ElementSymbol a1 = new ElementSymbol("a1"); //$NON-NLS-1$ a1.setType(DataTypeManager.DefaultDataClasses.STRING); symbols.add(a1); ElementSymbol a2 = new ElementSymbol("a2"); //$NON-NLS-1$ a1.setType(DataTypeManager.DefaultDataClasses.INTEGER); symbols.add(a2); DynamicCommand sqlCmd = new DynamicCommand(); Expression sql = new ElementSymbol("z"); //$NON-NLS-1$ sqlCmd.setSql(sql); sqlCmd.setAsColumns(symbols); sqlCmd.setAsClauseSet(true); sqlCmd.setIntoGroup(new GroupSymbol("#g")); //$NON-NLS-1$ sqlCmd.setUpdatingModelCount(1); CommandStatement cmdStmt = new CommandStatement(sqlCmd); helpStmtTest("execute IMMEDIATE z as a1 string, a2 integer into #g update 1;", "EXECUTE IMMEDIATE z AS a1 string, a2 integer INTO #g UPDATE 1;", //$NON-NLS-1$ //$NON-NLS-2$ cmdStmt); }
/** * @see org.teiid.query.sql.lang.QueryCommand#clone() */ public Object clone() { DynamicCommand clone = new DynamicCommand(); clone.setSql((Expression)getSql().clone()); if (asColumns != null) { List<ElementSymbol> cloneColumns = LanguageObject.Util.deepClone(asColumns, ElementSymbol.class); clone.setAsColumns(cloneColumns); } if (intoGroup != null) { clone.setIntoGroup(intoGroup.clone()); } if (using != null) { clone.setUsing((SetClauseList)using.clone()); } clone.setUpdatingModelCount(getUpdatingModelCount()); copyMetadataState(clone); clone.setAsClauseSet(isAsClauseSet()); return clone; }
/** * @see org.teiid.query.sql.lang.QueryCommand#clone() */ public Object clone() { DynamicCommand clone = new DynamicCommand(); clone.setSql((Expression)getSql().clone()); if (asColumns != null) { List<ElementSymbol> cloneColumns = LanguageObject.Util.deepClone(asColumns, ElementSymbol.class); clone.setAsColumns(cloneColumns); } if (intoGroup != null) { clone.setIntoGroup(intoGroup.clone()); } if (using != null) { clone.setUsing((SetClauseList)using.clone()); } clone.setUpdatingModelCount(getUpdatingModelCount()); copyMetadataState(clone); clone.setAsClauseSet(isAsClauseSet()); return clone; }
/** * @see org.teiid.query.sql.lang.QueryCommand#clone() */ public Object clone() { DynamicCommand clone = new DynamicCommand(); clone.setSql((Expression)getSql().clone()); if (asColumns != null) { List<ElementSymbol> cloneColumns = LanguageObject.Util.deepClone(asColumns, ElementSymbol.class); clone.setAsColumns(cloneColumns); } if (intoGroup != null) { clone.setIntoGroup(intoGroup.clone()); } if (using != null) { clone.setUsing((SetClauseList)using.clone()); } clone.setUpdatingModelCount(getUpdatingModelCount()); copyMetadataState(clone); clone.setAsClauseSet(isAsClauseSet()); return clone; }
dcStmt.setUpdatingModelCount(updateCount); {if (true) return dcStmt;} throw new Error("Missing return statement in function");
dcStmt.setUpdatingModelCount(updateCount); {if (true) return dcStmt;} throw new Error("Missing return statement in function");
dcStmt.setUpdatingModelCount(updateCount); {if (true) return dcStmt;} throw new Error("Missing return statement in function");