/** * Get hashcode for CreateUpdateProcedureCommand. WARNING: This hash code relies * on the hash codes of the block and the procedure type of this command. Hash code * is only valid after the command has been completely constructed. * @return Hash code */ public int hashCode() { // This hash code relies on the block and the procedure type for this command int myHash = 0; myHash = HashCodeUtil.hashCode(myHash, this.getBlock()); return myHash; }
/** * Get hashcode for CreateUpdateProcedureCommand. WARNING: This hash code relies * on the hash codes of the block and the procedure type of this command. Hash code * is only valid after the command has been completely constructed. * @return Hash code */ public int hashCode() { // This hash code relies on the block and the procedure type for this command int myHash = 0; myHash = HashCodeUtil.hashCode(myHash, this.getBlock()); return myHash; }
/** * Get hashcode for CreateUpdateProcedureCommand. WARNING: This hash code relies * on the hash codes of the block and the procedure type of this command. Hash code * is only valid after the command has been completely constructed. * @return Hash code */ public int hashCode() { // This hash code relies on the block and the procedure type for this command int myHash = 0; myHash = HashCodeUtil.hashCode(myHash, this.getBlock()); return myHash; }
private Command rewriteUpdateProcedure(CreateProcedureCommand command) throws TeiidComponentException { Block block = rewriteBlock(command.getBlock()); command.setBlock(block); return command; }
private Command rewriteUpdateProcedure(CreateProcedureCommand command) throws TeiidComponentException { Block block = rewriteBlock(command.getBlock()); command.setBlock(block); return command; }
private Command rewriteUpdateProcedure(CreateProcedureCommand command) throws TeiidComponentException { Block block = rewriteBlock(command.getBlock()); command.setBlock(block); return command; }
@Override public void visit( CreateProcedureCommand obj ) { addCacheHint(obj.getCacheHint()); visitNode(obj.getBlock()); }
@Override public void visit( CreateProcedureCommand obj ) { addCacheHint(obj.getCacheHint()); visitNode(obj.getBlock()); }
public void visit(CreateProcedureCommand obj) { preVisitVisitor(obj); visitNode(obj.getBlock()); postVisitVisitor(obj); } public void visit(DeclareStatement obj) {
public void visit(CreateProcedureCommand obj) { preVisitVisitor(obj); visitNode(obj.getBlock()); postVisitVisitor(obj); } public void visit(DeclareStatement obj) {
@Override public void visit( CreateProcedureCommand obj ) { addCacheHint(obj.getCacheHint()); visitNode(obj.getBlock()); }
public void visit(CreateProcedureCommand obj) { preVisitVisitor(obj); visitNode(obj.getBlock()); postVisitVisitor(obj); } public void visit(DeclareStatement obj) {
/** * 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 testGetBlock() { CreateProcedureCommand b1 = sample1(); assertTrue("Incorrect Block on command", b1.getBlock().equals(TestBlock.sample1())); //$NON-NLS-1$ }
@Override public void visit(AlterProcedure alterProcedure) { append(ALTER); append(SPACE); append(PROCEDURE); append(SPACE); append(alterProcedure.getTarget()); beginClause(1); append(AS); addCacheHint(alterProcedure.getCacheHint()); append(alterProcedure.getDefinition().getBlock()); }
@Override public void visit(AlterProcedure alterProcedure) { append(ALTER); append(SPACE); append(PROCEDURE); append(SPACE); append(alterProcedure.getTarget()); beginClause(1); append(AS); addCacheHint(alterProcedure.getCacheHint()); append(alterProcedure.getDefinition().getBlock()); }
@Override public void visit(AlterProcedure alterProcedure) { append(ALTER); append(SPACE); append(PROCEDURE); append(SPACE); append(alterProcedure.getTarget()); beginClause(1); append(AS); addCacheHint(alterProcedure.getCacheHint()); append(alterProcedure.getDefinition().getBlock()); }
@Test public void testReturnAndResultSet() throws Exception { String ddl = "CREATE FOREIGN PROCEDURE proc (OUT param STRING RESULT) RETURNS TABLE (a INTEGER, b STRING);"; //$NON-NLS-1$ TransformationMetadata tm = RealMetadataFactory.fromDDL(ddl, "x", "y"); StoredProcedure sp = (StoredProcedure) TestResolver.helpResolve("exec proc()", tm); assertEquals(2, sp.getProjectedSymbols().size()); assertEquals("y.proc.b", sp.getProjectedSymbols().get(1).toString()); assertTrue(sp.returnsResultSet()); sp.setCallableStatement(true); assertEquals(3, sp.getProjectedSymbols().size()); assertEquals("y.proc.param", sp.getProjectedSymbols().get(2).toString()); CreateProcedureCommand cpc = (CreateProcedureCommand) TestResolver.helpResolve("begin exec proc(); end", tm); assertEquals(2, cpc.getProjectedSymbols().size()); assertEquals(2, ((CommandStatement)cpc.getBlock().getStatements().get(0)).getCommand().getProjectedSymbols().size()); assertTrue(cpc.returnsResultSet()); TestValidator.helpValidate("begin declare string var; var = exec proc(); select var; end", new String[] {"SELECT var;"}, tm); }
public void testSetBlock() { CreateProcedureCommand b1 = (CreateProcedureCommand)sample1().clone(); b1.setBlock(TestBlock.sample2()); assertTrue("Incorrect Block on command", b1.getBlock().equals(TestBlock.sample2())); //$NON-NLS-1$ }
@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()); }