/** * @see org.teiid.query.sql.LanguageVisitor#visit(org.teiid.query.sql.proc.AssignmentStatement) * @since 5.0 */ public void visit(AssignmentStatement obj) { obj.setExpression(replaceExpression(obj.getExpression())); }
/** * @see org.teiid.query.sql.LanguageVisitor#visit(org.teiid.query.sql.proc.AssignmentStatement) * @since 5.0 */ public void visit(AssignmentStatement obj) { obj.setExpression(replaceExpression(obj.getExpression())); }
/** * @see org.teiid.query.sql.LanguageVisitor#visit(org.teiid.query.sql.proc.AssignmentStatement) * @since 5.0 */ public void visit(AssignmentStatement obj) { obj.setExpression(replaceExpression(obj.getExpression())); }
/** * @param obj * @param parts */ private void createAssignment( AssignmentStatement obj ) { visitNode(obj.getVariable()); if (obj.getExpression() != null) { append(" = "); //$NON-NLS-1$ visitNode(obj.getExpression()); } append(";"); //$NON-NLS-1$ }
/** * @param obj * @param parts */ private void createAssignment( AssignmentStatement obj ) { visitNode(obj.getVariable()); if (obj.getExpression() != null) { append(" = "); //$NON-NLS-1$ visitNode(obj.getExpression()); } append(";"); //$NON-NLS-1$ }
/** * @param obj * @param parts */ private void createAssignment( AssignmentStatement obj ) { visitNode(obj.getVariable()); if (obj.getExpression() != null) { append(" = "); //$NON-NLS-1$ visitNode(obj.getExpression()); } append(";"); //$NON-NLS-1$ }
/** * Get hashcode for AssignmentStatement. WARNING: This hash code relies on the hash codes * of the variable and its value which could be a command or an expression. * @return Hash code */ public int hashCode() { // This hash code relies on the variable and its value for this statement // and criteria clauses, not on the from, order by, or option clauses int myHash = 0; myHash = HashCodeUtil.hashCode(myHash, this.getVariable()); myHash = HashCodeUtil.hashCode(myHash, this.getExpression()); return myHash; }
/** * Get hashcode for AssignmentStatement. WARNING: This hash code relies on the hash codes * of the variable and its value which could be a command or an expression. * @return Hash code */ public int hashCode() { // This hash code relies on the variable and its value for this statement // and criteria clauses, not on the from, order by, or option clauses int myHash = 0; myHash = HashCodeUtil.hashCode(myHash, this.getVariable()); myHash = HashCodeUtil.hashCode(myHash, this.getExpression()); return myHash; }
/** * Compare two AssignmentStatements for equality. They will only evaluate to equal if * they are IDENTICAL: variable and its value which could be a command or an expression * 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 AssignmentStatement)) { return false; } AssignmentStatement other = (AssignmentStatement) obj; return // Compare the variables EquivalenceUtil.areEqual(this.getVariable(), other.getVariable()) && // Compare the values EquivalenceUtil.areEqual(this.getExpression(), other.getExpression()); // Compare the values }
/** * Compare two AssignmentStatements for equality. They will only evaluate to equal if * they are IDENTICAL: variable and its value which could be a command or an expression * 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 AssignmentStatement)) { return false; } AssignmentStatement other = (AssignmentStatement) obj; return // Compare the variables EquivalenceUtil.areEqual(this.getVariable(), other.getVariable()) && // Compare the values EquivalenceUtil.areEqual(this.getExpression(), other.getExpression()); // Compare the values }
/** * Compare two AssignmentStatements for equality. They will only evaluate to equal if * they are IDENTICAL: variable and its value which could be a command or an expression * 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 AssignmentStatement)) { return false; } AssignmentStatement other = (AssignmentStatement) obj; return // Compare the variables EquivalenceUtil.areEqual(this.getVariable(), other.getVariable()) && // Compare the values EquivalenceUtil.areEqual(this.getExpression(), other.getExpression()); // Compare the values }
/** * Get hashcode for AssignmentStatement. WARNING: This hash code relies on the hash codes * of the variable and its value which could be a command or an expression. * @return Hash code */ public int hashCode() { // This hash code relies on the variable and its value for this statement // and criteria clauses, not on the from, order by, or option clauses int myHash = 0; myHash = HashCodeUtil.hashCode(myHash, this.getVariable()); myHash = HashCodeUtil.hashCode(myHash, this.getExpression()); return myHash; }
public void visit(AssignmentStatement obj) { preVisitVisitor(obj); visitNode(obj.getVariable()); visitNode(obj.getExpression()); postVisitVisitor(obj); } public void visit(BatchedUpdateCommand obj) {
public void visit(AssignmentStatement obj) { preVisitVisitor(obj); visitNode(obj.getVariable()); visitNode(obj.getExpression()); postVisitVisitor(obj); } public void visit(BatchedUpdateCommand obj) {
public void visit(AssignmentStatement obj) { preVisitVisitor(obj); visitNode(obj.getVariable()); visitNode(obj.getExpression()); postVisitVisitor(obj); } public void visit(BatchedUpdateCommand obj) {
public void testGetExpression() { AssignmentStatement s1 = sample1(); assertEquals("Didn't get the same parts ", s1.getExpression(), new Constant("1")); //$NON-NLS-1$ //$NON-NLS-2$ }
assertEquals(ProcedureReservedWords.VARIABLES, ((ElementSymbol)assStmt.getExpression()).getGroupSymbol().getName()); ElementSymbol value = ElementCollectorVisitor.getElements(assStmt.getExpression(), false).iterator().next();
public void testGetCommand() throws Exception { AssignmentStatement s2 = sample2(); Query query = (Query) QueryParser.getQueryParser().parseCommand("Select x from y"); //$NON-NLS-1$ assertEquals("Didn't get the same parts ", ((ScalarSubquery)s2.getExpression()).getCommand(), query); //$NON-NLS-1$ }
Expression asigExpr = assignStmt.getExpression(); assignInstr.setExpression(asigExpr); if(debug) {
Expression asigExpr = assignStmt.getExpression(); assignInstr.setExpression(asigExpr); if(debug) {