/** * Visit a language object and collect symbols. This method should <b>NOT</b> be * called directly. * @param obj Language object */ public void visit(CommandStatement obj) { this.commands.add(obj.getCommand()); }
/** * Visit a language object and collect symbols. This method should <b>NOT</b> be * called directly. * @param obj Language object */ public void visit(CommandStatement obj) { this.commands.add(obj.getCommand()); }
/** * Get hashcode for CommandStatement. WARNING: This hash code relies on the * hash code of the command on this statement. * @return Hash code */ public int hashCode() { // This hash code relies on the commands hash code return this.getCommand().hashCode(); }
/** * Get hashcode for CommandStatement. WARNING: This hash code relies on the * hash code of the command on this statement. * @return Hash code */ public int hashCode() { // This hash code relies on the commands hash code return this.getCommand().hashCode(); }
/** * Visit a language object and collect symbols. This method should <b>NOT</b> be * called directly. * @param obj Language object */ public void visit(CommandStatement obj) { this.commands.add(obj.getCommand()); }
/** * Get hashcode for CommandStatement. WARNING: This hash code relies on the * hash code of the command on this statement. * @return Hash code */ public int hashCode() { // This hash code relies on the commands hash code return this.getCommand().hashCode(); }
/** * Compare two CommandStatements for equality. They will only evaluate to equal if * they are IDENTICAL: the command objects are equal. * @param obj Other object * @return True if equal */ public boolean equals(Object obj) { // Quick same object test if(this == obj) { return true; } // Quick fail tests if(!(obj instanceof CommandStatement)) { return false; } return EquivalenceUtil.areEqual(getCommand(), ((CommandStatement)obj).getCommand()); }
public void visit(CommandStatement obj) { preVisitVisitor(obj); if (deep) { visitNode(obj.getCommand()); } postVisitVisitor(obj); } public void visit(CompareCriteria obj) {
public void visit(CommandStatement obj) { preVisitVisitor(obj); if (deep) { visitNode(obj.getCommand()); } postVisitVisitor(obj); } public void visit(CompareCriteria obj) {
public void visit(CommandStatement obj) { preVisitVisitor(obj); if (deep) { visitNode(obj.getCommand()); } postVisitVisitor(obj); } public void visit(CompareCriteria obj) {
@Override public void visit(CommandStatement obj) { if (this.createProc == null || this.createProc.getResultSetColumns().isEmpty() || !obj.isReturnable() || !obj.getCommand().returnsResultSet()) { return; } List<? extends Expression> symbols = obj.getCommand().getResultSetColumns(); if (symbols == null && obj.getCommand() instanceof DynamicCommand) { DynamicCommand cmd = (DynamicCommand)obj.getCommand(); cmd.setAsColumns(this.createProc.getResultSetColumns()); return; } try { QueryResolver.validateProjectedSymbols(createProc.getVirtualGroup(), createProc.getResultSetColumns(), symbols); } catch (QueryValidatorException e) { handleValidationError(QueryPlugin.Util.gs(QueryPlugin.Event.TEIID31121, createProc.getVirtualGroup(), obj, e.getMessage()), obj); } }
@Override public void visit(CommandStatement obj) { if (this.createProc == null || this.createProc.getResultSetColumns().isEmpty() || !obj.isReturnable() || !obj.getCommand().returnsResultSet()) { return; } List<? extends Expression> symbols = obj.getCommand().getResultSetColumns(); if (symbols == null && obj.getCommand() instanceof DynamicCommand) { DynamicCommand cmd = (DynamicCommand)obj.getCommand(); cmd.setAsColumns(this.createProc.getResultSetColumns()); return; } try { QueryResolver.validateProjectedSymbols(createProc.getVirtualGroup(), createProc.getResultSetColumns(), symbols); } catch (QueryValidatorException e) { handleValidationError(QueryPlugin.Util.gs(QueryPlugin.Event.TEIID31121, createProc.getVirtualGroup(), obj, e.getMessage()), obj); } }
private Mode getMode(CreateProcedureCommand parentProcCommand, CommandStatement cmdStmt, Command command) { if (!command.returnsResultSet()&&!(command instanceof StoredProcedure)) { return Mode.UPDATE; } if (parentProcCommand.returnsResultSet()&&cmdStmt.isReturnable()&&cmdStmt.getCommand().returnsResultSet()) { return Mode.HOLD; } return Mode.NOHOLD; }
private Mode getMode(CreateProcedureCommand parentProcCommand, CommandStatement cmdStmt, Command command) { if (!command.returnsResultSet()&&!(command instanceof StoredProcedure)) { return Mode.UPDATE; } if (parentProcCommand.returnsResultSet()&&cmdStmt.isReturnable()&&cmdStmt.getCommand().returnsResultSet()) { return Mode.HOLD; } return Mode.NOHOLD; }
private Mode getMode(CreateProcedureCommand parentProcCommand, CommandStatement cmdStmt, Command command) { if (!command.returnsResultSet()&&!(command instanceof StoredProcedure)) { return Mode.UPDATE; } if (parentProcCommand.returnsResultSet()&&cmdStmt.isReturnable()&&cmdStmt.getCommand().returnsResultSet()) { return Mode.HOLD; } return Mode.NOHOLD; }
@Override public void visit( CommandStatement obj ) { visitNode(obj.getCommand()); if (!obj.isReturnable()) { append(SPACE); append(WITHOUT); append(SPACE); append(RETURN); } append(";"); //$NON-NLS-1$ }
@Override public void visit( CommandStatement obj ) { visitNode(obj.getCommand()); if (!obj.isReturnable()) { append(SPACE); append(WITHOUT); append(SPACE); append(RETURN); } append(";"); //$NON-NLS-1$ }
@Override public void visit( CommandStatement obj ) { visitNode(obj.getCommand()); if (!obj.isReturnable()) { append(SPACE); append(WITHOUT); append(SPACE); append(RETURN); } append(";"); //$NON-NLS-1$ }
/** * Constants will now auto resolve if they are consistently representable in the target type */ @Test public void testDefect23257() throws Exception{ CreateProcedureCommand command = (CreateProcedureCommand) helpResolve("EXEC pm6.vsp59()", RealMetadataFactory.example1Cached()); //$NON-NLS-1$ CommandStatement cs = (CommandStatement)command.getBlock().getStatements().get(1); Insert insert = (Insert)cs.getCommand(); assertEquals(DataTypeManager.DefaultDataClasses.SHORT, ((Expression)insert.getValues().get(1)).getType()); }
@Test public void testAlterProcedure() { AlterProcedure alterProc = (AlterProcedure) helpResolve("alter procedure MMSP5 as begin select param1; end", RealMetadataFactory.exampleBQTCached()); assertNotNull(alterProc.getTarget().getMetadataID()); Query q = (Query)((CommandStatement)alterProc.getDefinition().getBlock().getStatements().get(0)).getCommand(); assertTrue(((ElementSymbol)q.getSelect().getSymbol(0)).isExternalReference()); }