/** * Deep clone statement to produce a new identical statement. * @return Deep clone */ public Object clone() { Block otherIf = this.ifBlock.clone(); Criteria otherCrit = (Criteria) this.condition.clone(); Block otherElse = null; if(this.hasElseBlock()) { otherElse = this.elseBlock.clone(); } return new IfStatement(otherCrit, otherIf, otherElse); }
/** * Deep clone statement to produce a new identical statement. * @return Deep clone */ public Object clone() { Block otherIf = this.ifBlock.clone(); Criteria otherCrit = (Criteria) this.condition.clone(); Block otherElse = null; if(this.hasElseBlock()) { otherElse = this.elseBlock.clone(); } return new IfStatement(otherCrit, otherIf, otherElse); }
/** * Deep clone statement to produce a new identical statement. * @return Deep clone */ public Object clone() { Block otherIf = this.ifBlock.clone(); Criteria otherCrit = (Criteria) this.condition.clone(); Block otherElse = null; if(this.hasElseBlock()) { otherElse = this.elseBlock.clone(); } return new IfStatement(otherCrit, otherIf, otherElse); }
@Override public TriggerAction clone() { TriggerAction clone = new TriggerAction(this.block.clone()); if (this.view != null) { clone.setView(view.clone()); } return clone; }
/** * Deep clone statement to produce a new identical statement. * @return Deep clone */ public Object clone() { Block otherBlock = this.loopBlock.clone(); Command otherQuery = (Command) this.query.clone(); LoopStatement ls = new LoopStatement(otherBlock, otherQuery, this.cursorName); ls.setLabel(label); return ls; }
/** * Deep clone statement to produce a new identical statement. * @return Deep clone */ public Object clone() { Block otherBlock = this.loopBlock.clone(); Command otherQuery = (Command) this.query.clone(); LoopStatement ls = new LoopStatement(otherBlock, otherQuery, this.cursorName); ls.setLabel(label); return ls; }
/** * Deep clone statement to produce a new identical statement. * @return Deep clone */ public Object clone() { Block otherBlock = this.whileBlock.clone(); Criteria otherCrit = (Criteria) this.condition.clone(); WhileStatement ws = new WhileStatement(otherCrit, otherBlock); ws.setLabel(label); return ws; }
@Override public TriggerAction clone() { TriggerAction clone = new TriggerAction(this.block.clone()); if (this.view != null) { clone.setView(view.clone()); } return clone; }
/** * Deep clone statement to produce a new identical statement. * @return Deep clone */ public Object clone() { Block otherBlock = this.whileBlock.clone(); Criteria otherCrit = (Criteria) this.condition.clone(); WhileStatement ws = new WhileStatement(otherCrit, otherBlock); ws.setLabel(label); return ws; }
@Override public TriggerAction clone() { TriggerAction clone = new TriggerAction(this.block.clone()); if (this.view != null) { clone.setView(view.clone()); } return clone; }
/** * Deep clone statement to produce a new identical statement. * @return Deep clone */ public Object clone() { Block otherBlock = this.whileBlock.clone(); Criteria otherCrit = (Criteria) this.condition.clone(); WhileStatement ws = new WhileStatement(otherCrit, otherBlock); ws.setLabel(label); return ws; }
/** * Deep clone statement to produce a new identical statement. * @return Deep clone */ public Object clone() { Block otherBlock = this.loopBlock.clone(); Command otherQuery = (Command) this.query.clone(); LoopStatement ls = new LoopStatement(otherBlock, otherQuery, this.cursorName); ls.setLabel(label); return ls; }
@Test public void testClone() { Block b1 = sample1(); Block b2 = b1.clone(); UnitTestUtil.helpTestEquivalence(0, b1, b2); assertNotSame(b1.getStatements().get(0), b2.getStatements().get(0)); }
/** * Deep clone statement to produce a new identical statement. * @return Deep clone */ public Object clone() { CreateProcedureCommand copy = new CreateProcedureCommand(); //Clone this class state if (this.block != null) { copy.setBlock(this.block.clone()); } if (this.projectedSymbols != null) { copy.projectedSymbols = LanguageObject.Util.deepClone(this.projectedSymbols, Expression.class); } if (this.resultSetColumns != null) { copy.resultSetColumns = LanguageObject.Util.deepClone(this.resultSetColumns, Expression.class); } if (this.virtualGroup != null) { copy.virtualGroup = this.virtualGroup.clone(); } if (this.returnVariable != null) { copy.returnVariable = this.returnVariable; } copy.updateType = this.updateType; this.copyMetadataState(copy); return copy; }
/** * Deep clone statement to produce a new identical statement. * @return Deep clone */ public Object clone() { CreateProcedureCommand copy = new CreateProcedureCommand(); //Clone this class state if (this.block != null) { copy.setBlock(this.block.clone()); } if (this.projectedSymbols != null) { copy.projectedSymbols = LanguageObject.Util.deepClone(this.projectedSymbols, Expression.class); } if (this.resultSetColumns != null) { copy.resultSetColumns = LanguageObject.Util.deepClone(this.resultSetColumns, Expression.class); } if (this.virtualGroup != null) { copy.virtualGroup = this.virtualGroup.clone(); } if (this.returnVariable != null) { copy.returnVariable = this.returnVariable; } copy.updateType = this.updateType; this.copyMetadataState(copy); return copy; }
/** * Deep clone statement to produce a new identical statement. * @return Deep clone */ public Object clone() { CreateProcedureCommand copy = new CreateProcedureCommand(); //Clone this class state if (this.block != null) { copy.setBlock(this.block.clone()); } if (this.projectedSymbols != null) { copy.projectedSymbols = LanguageObject.Util.deepClone(this.projectedSymbols, Expression.class); } if (this.resultSetColumns != null) { copy.resultSetColumns = LanguageObject.Util.deepClone(this.resultSetColumns, Expression.class); } if (this.virtualGroup != null) { copy.virtualGroup = this.virtualGroup.clone(); } if (this.returnVariable != null) { copy.returnVariable = this.returnVariable; } copy.updateType = this.updateType; this.copyMetadataState(copy); return copy; }
@Test public void testaddStatement2() { Block b1 = sample2().clone(); b1.addStatement(TestCommandStatement.sample2()); Statement stmt = b1.getStatements().get(4); assertTrue("Incorrect statement in the Block", stmt.equals(TestCommandStatement.sample2())); //$NON-NLS-1$ }
@Test public void testaddStatement1() { Block b1 = sample1().clone(); b1.addStatement(TestCommandStatement.sample2()); assertTrue("Incorrect number of statements in the Block", (b1.getStatements().size() == 5)); //$NON-NLS-1$ }
@Test public void testExceptionGroup() { Block b1 = sample1(); Block b2 = b1.clone(); b1.setExceptionGroup("x"); b2.setExceptionGroup("y"); assertFalse(b1.equals(b2)); }