/** */ public Object newWhereClause(int line, int column, Object condition) { WhereNode node = new WhereNode(); node.setContext(context); node.setLeft((Node)condition); setPosition(node, line, column); return node; }
/** * INTERNAL * This method handles any unqualified field access in bulk UPDATE and * DELETE statements. A UPDATE or DELETE statement may not define an * identification variable. In this case any field accessed from the * current class is not qualified with an identification variable, e.g. * UPDATE Customer SET name = :newname * The method goes through the expressions of the SET clause and the WHERE * clause of such an DELETE and UPDATE statement and qualifies the field * access using the abstract schema name as qualifier. */ protected void qualifyAttributeAccess(ParseTreeContext context) { if ((queryNode.isUpdateNode() || queryNode.isDeleteNode()) && ((ModifyNode)queryNode).getAbstractSchemaIdentifier() == null) { if (setNode != null) { setNode.qualifyAttributeAccess(context); } if (whereNode != null) { whereNode.qualifyAttributeAccess(context); } } }
/** * INTERNAL * Validate node and calculate its type. */ public void validate(ParseTreeContext context) { if (left != null) { left.validate(context); TypeHelper typeHelper = context.getTypeHelper(); setType(typeHelper.getBooleanType()); } }
/** * INTERNAL * Build a context for the expression generation */ public Expression generateExpression(DatabaseQuery readQuery, GenerationContext generationContext) { Expression selectExpression = getQueryNode().generateExpression(generationContext); if (getWhereNode() == null) { return selectExpression; } Expression whereExpression = getWhereNode().generateExpression(generationContext); selectExpression = getQueryNode().generateExpression(generationContext); if (selectExpression != null) { whereExpression = selectExpression.and(whereExpression); } return whereExpression; }
whereNode.validate(context);
/** * INTERNAL * This method handles any unqualified field access in bulk UPDATE and * DELETE statements. A UPDATE or DELETE statement may not define an * identification variable. In this case any field accessed from the * current class is not qualified with an identification variable, e.g. * UPDATE Customer SET name = :newname * The method goes through the expressions of the SET clause and the WHERE * clause of such an DELETE and UPDATE statement and qualifies the field * access using the abstract schema name as qualifier. */ protected void qualifyAttributeAccess(ParseTreeContext context) { if ((queryNode.isUpdateNode() || queryNode.isDeleteNode()) && ((ModifyNode)queryNode).getAbstractSchemaIdentifier() == null) { if (setNode != null) { setNode.qualifyAttributeAccess(context); } if (whereNode != null) { whereNode.qualifyAttributeAccess(context); } } }
/** * INTERNAL * Validate node and calculate its type. */ public void validate(ParseTreeContext context) { if (left != null) { left.validate(context); TypeHelper typeHelper = context.getTypeHelper(); setType(typeHelper.getBooleanType()); } }
/** * INTERNAL * Build a context for the expression generation */ public Expression generateExpression(DatabaseQuery readQuery, GenerationContext generationContext) { Expression selectExpression = getQueryNode().generateExpression(generationContext); if (getWhereNode() == null) { return selectExpression; } Expression whereExpression = getWhereNode().generateExpression(generationContext); selectExpression = getQueryNode().generateExpression(generationContext); if (selectExpression != null) { whereExpression = selectExpression.and(whereExpression); } return whereExpression; }
whereNode.validate(context);
/** */ public Object newWhereClause(int line, int column, Object condition) { WhereNode node = new WhereNode(); node.setContext(context); node.setLeft((Node)condition); setPosition(node, line, column); return node; }
/** * INTERNAL * This method handles any unqualified field access in bulk UPDATE and * DELETE statements. A UPDATE or DELETE statement may not define an * identification variable. In this case any field accessed from the * current class is not qualified with an identification variable, e.g. * UPDATE Customer SET name = :newname * The method goes through the expressions of the SET clause and the WHERE * clause of such an DELETE and UPDATE statement and qualifies the field * access using the abstract schema name as qualifier. */ protected void qualifyAttributeAccess(ParseTreeContext context) { if ((queryNode.isUpdateNode() || queryNode.isDeleteNode()) && ((ModifyNode)queryNode).getAbstractSchemaIdentifier() == null) { if (setNode != null) { setNode.qualifyAttributeAccess(context); } if (whereNode != null) { whereNode.qualifyAttributeAccess(context); } } }
/** * INTERNAL * Validate node and calculate its type. */ public void validate(ParseTreeContext context) { if (left != null) { left.validate(context); TypeHelper typeHelper = context.getTypeHelper(); setType(typeHelper.getBooleanType()); } }
/** * INTERNAL * Build a context for the expression generation */ public Expression generateExpression(DatabaseQuery readQuery, GenerationContext generationContext) { Expression selectExpression = getQueryNode().generateExpression(generationContext); if (getWhereNode() == null) { return selectExpression; } Expression whereExpression = getWhereNode().generateExpression(generationContext); selectExpression = getQueryNode().generateExpression(generationContext); if (selectExpression != null) { whereExpression = selectExpression.and(whereExpression); } return whereExpression; }
whereNode.validate(context);
/** */ public Object newWhereClause(int line, int column, Object condition) { WhereNode node = new WhereNode(); node.setContext(context); node.setLeft((Node)condition); setPosition(node, line, column); return node; }
/** * INTERNAL * If called the subquery is part of the WHERE clause of an UPDATE or * DELETE statement that does not define an identification variable. * The method checks the clauses of the subquery for unqualified fields * accesses. */ public Node qualifyAttributeAccess(ParseTreeContext context) { subqueryParseTree.getFromNode().qualifyAttributeAccess(context); subqueryParseTree.getQueryNode().qualifyAttributeAccess(context); if (subqueryParseTree.getWhereNode() != null) { subqueryParseTree.getWhereNode().qualifyAttributeAccess(context); } if (subqueryParseTree.getGroupByNode() != null) { subqueryParseTree.getGroupByNode().qualifyAttributeAccess(context); } if (subqueryParseTree.getHavingNode() != null) { subqueryParseTree.getHavingNode().qualifyAttributeAccess(context); } return this; }
/** * INTERNAL * If called the subquery is part of the WHERE clause of an UPDATE or * DELETE statement that does not define an identification variable. * The method checks the clauses of the subquery for unqualified fields * accesses. */ public Node qualifyAttributeAccess(ParseTreeContext context) { subqueryParseTree.getFromNode().qualifyAttributeAccess(context); subqueryParseTree.getQueryNode().qualifyAttributeAccess(context); if (subqueryParseTree.getWhereNode() != null) { subqueryParseTree.getWhereNode().qualifyAttributeAccess(context); } if (subqueryParseTree.getGroupByNode() != null) { subqueryParseTree.getGroupByNode().qualifyAttributeAccess(context); } if (subqueryParseTree.getHavingNode() != null) { subqueryParseTree.getHavingNode().qualifyAttributeAccess(context); } return this; }