private void registerSchema(String variable, String schema, int line, int column) { if (variable != null) { context.registerSchema(variable, schema, line, column); } else { // UPDATE and DELETE may not define a variable => // use schema name as variable context.registerSchema(calculateCanonicalName(schema), schema, line, column); } }
/** INTERNAL Validate the current node and calculates its type. */ public void validate(ParseTreeContext context) { TypeHelper typeHelper = context.getTypeHelper(); if (left != null) { left.validate(context); left.validateParameter(context, typeHelper.getStringType()); } setType(typeHelper.getIntType()); }
public Object newVariableDecl(int line, int column, Object path, String variable) { DotNode dotNode = (DotNode) path; AttributeNode rightNode = (AttributeNode) dotNode.getRight(); JoinDeclNode node = new JoinDeclNode(); node.setPath(dotNode); node.setVariableName(variable); setPosition(node, line, column); context.registerJoinVariable(node.getCanonicalVariableName(), dotNode, line, column); currentIdentificationVariable = variable; return node; }
public Object newFetchJoin(int line, int column, boolean outerJoin, Object path) { DotNode dotNode = (DotNode) path; AttributeNode rightNode = (AttributeNode) dotNode.getRight(); rightNode.setOuterJoin(outerJoin); // register the dot expression to be added as joined attribute FetchJoinNode node = new FetchJoinNode(); node.setPath(dotNode); node.setOuterJoin(outerJoin); setPosition(node, line, column); context.registerFetchJoin(dotNode.getLeft().getAsString(), dotNode); return node; }
public Object newCollectionMemberVariableDecl( int line, int column, Object path, String variable) { DotNode dotNode = (DotNode) path; AttributeNode rightNode = (AttributeNode) dotNode.getRight(); // The IN-clause expression must be a collection valued path expression rightNode.setRequiresCollectionAttribute(true); CollectionMemberDeclNode node = new CollectionMemberDeclNode(); node.setPath(dotNode); node.setVariableName(variable); setPosition(node, line, column); context.registerJoinVariable(node.getCanonicalVariableName(), dotNode, line, column); currentIdentificationVariable = variable; return node; }
/** INTERNAL Validate node and calculate its type. */ public void validate(ParseTreeContext context) { TypeHelper typeHelper = context.getTypeHelper(); if (findIn != null) { findIn.validate(context); findIn.validateParameter(context, typeHelper.getStringType()); } if (find != null) { find.validate(context); find.validateParameter(context, typeHelper.getStringType()); } if (startPosition != null) { startPosition.validate(context); startPosition.validateParameter(context, typeHelper.getIntType()); } setType(typeHelper.getIntType()); }
public Object newNamedParameter(int line, int column, String name) { ParameterNode node = new ParameterNode(name); context.addParameter(name); setPosition(node, line, column); return node; }
public Object newPositionalParameter(int line, int column, String position) { ParameterNode node = new ParameterNode(position); context.addParameter(position); setPosition(node, line, column); return node; }
/** INTERNAL Validate node and calculate its type. */ public void validate(ParseTreeContext context) { TypeHelper typeHelper = context.getTypeHelper(); setType(typeHelper.getBooleanType()); }