/** * INTERNAL * Return the left most node of a dot expr, so return 'a' for 'a.b.c'. */ public Node getLeftMostNode() { if (left.isDotNode()){ return ((DotNode)left).getLeftMostNode(); } return left; }
/** * Answer true if the SELECT ends in a direct-to-field. * true: SELECT phone.areaCode * false: SELECT employee.address */ private boolean selectingDirectToField(Node node, GenerationContext context) { if ((node == null) || !node.isDotNode()) { return false; } return ((DotNode)node).endsWithDirectToField(context); }
/** * INTERNAL * Return the left most node of a dot expr, so return 'a' for 'a.b.c'. */ public Node getLeftMostNode() { if (left.isDotNode()){ return ((DotNode)left).getLeftMostNode(); } return left; }
/** * Answer true if the SELECT ends in a direct-to-field. * true: SELECT phone.areaCode * false: SELECT employee.address */ private boolean selectingDirectToField(Node node, GenerationContext context) { if ((node == null) || !node.isDotNode()) { return false; } return ((DotNode)node).endsWithDirectToField(context); }
/** * Answer true if the SELECT ends in a direct-to-field. * true: SELECT phone.areaCode * false: SELECT employee.address */ private boolean selectingDirectToField(Node node, GenerationContext context) { if ((node == null) || !node.isDotNode()) { return false; } return ((DotNode)node).endsWithDirectToField(context); }
/** * INTERNAL */ private boolean selectingRelationshipField(Node node, GenerationContext context) { if ((node == null) || !node.isDotNode()) { return false; } return !((DotNode)node).endsWithDirectToField(context); }
/** * INTERNAL * Return the left most node of a dot expr, so return 'a' for 'a.b.c'. */ public Node getLeftMostNode() { if (left.isDotNode()){ return ((DotNode)left).getLeftMostNode(); } return left; }
/** * INTERNAL * Return the right most node of a dot expr, so return 'c' for 'a.b.c'. */ public Node getRightMostNode() { if (right.isDotNode()){ return ((DotNode)right).getRightMostNode(); } return right; }
/** * INTERNAL */ public String resolveAttribute() { Node arg = getLeft(); return arg.isDotNode() ? ((DotNode)arg).resolveAttribute() : null; }
/** * INTERNAL */ public String resolveAttribute() { Node arg = getLeft(); return arg.isDotNode() ? ((DotNode)arg).resolveAttribute() : null; }
/** * INTERNAL * Return the left most node of a dot expr, so return 'a' for 'a.b.c'. */ public Node getLeftMostNode() { if (left.isDotNode()){ return ((DotNode)left).getLeftMostNode(); } else if (left.isMapKeyNode()){ return ((MapKeyNode)left).getLeftMostNode(); } return left; }
/** * INTERNAL * Return the left most node of a dot expr, so return 'a' for 'a.b.c'. */ public Node getLeftMostNode() { if (left.isDotNode()){ return ((DotNode)left).getLeftMostNode(); } else if (left.isMapKeyNode()){ return ((MapKeyNode)left).getLeftMostNode(); } return left; }
/** * INTERNAL * Apply this node to the passed query */ public void applyToQuery(ObjectLevelReadQuery theQuery, GenerationContext context) { if (theQuery.isReportQuery()) { ReportQuery reportQuery = (ReportQuery)theQuery; String attrName = getLeft().isDotNode() ? resolveAttribute() : "COUNT"; reportQuery.addAttribute(attrName, generateExpression(context), Long.class); } }
/** * INTERNAL * Apply this node to the passed query */ public void applyToQuery(ObjectLevelReadQuery theQuery, GenerationContext context) { if (theQuery.isReportQuery()) { ReportQuery reportQuery = (ReportQuery)theQuery; String attrName = getLeft().isDotNode() ? resolveAttribute() : "COUNT"; reportQuery.addAttribute(attrName, generateExpression(context), Long.class); } }
/** * INTERNAL * Apply this node to the passed query */ public void applyToQuery(ObjectLevelReadQuery theQuery, GenerationContext context) { if (theQuery.isReportQuery()) { ReportQuery reportQuery = (ReportQuery)theQuery; String attrName = getLeft().isDotNode() ? resolveAttribute() : "COUNT"; reportQuery.addAttribute(attrName, generateExpression(context), Long.class); } }
public void validate(ParseTreeContext context) { left.validate(context); if (left.isVariableNode()){ setType(((VariableNode)left).getTypeForMapKey(context)); } else if (left.isDotNode()){ setType(((DotNode)left).getTypeForMapKey(context)); } }
private boolean selectingRelationshipField(Node node, GenerationContext context) { if ((node == null) || !node.isDotNode()) { return false; } TypeHelper typeHelper = context.getParseTreeContext().getTypeHelper(); Node path = node.getLeft(); AttributeNode attribute = (AttributeNode)node.getRight(); return typeHelper.isRelationship(path.getType(), attribute.getAttributeName()); }
private boolean selectingRelationshipField(Node node, GenerationContext context) { if ((node == null) || !node.isDotNode()) { return false; } TypeHelper typeHelper = context.getParseTreeContext().getTypeHelper(); Node path = node.getLeft(); AttributeNode attribute = (AttributeNode)node.getRight(); return typeHelper.isRelationship(path.getType(), attribute.getAttributeName()); }
/** * INTERNAL */ private boolean selectingRelationshipField(Node node, GenerationContext context) { if ((node == null) || !node.isDotNode()) { return false; } TypeHelper typeHelper = context.getParseTreeContext().getTypeHelper(); Node path = node.getLeft(); AttributeNode attribute = (AttributeNode)node.getRight(); return typeHelper.isRelationship(path.getType(), attribute.getAttributeName()); }
public void validate(ParseTreeContext context) { TypeHelper typeHelper = context.getTypeHelper(); left.validate(context); if (left.isVariableNode()){ setType(((VariableNode)left).getTypeForMapKey(context)); } else if (left.isDotNode()){ setType(((DotNode)left).getTypeForMapKey(context)); } } }