/** * INTERNAL * Checks whether the left hand side of this dot node is navigable. */ private void checkNavigation(Node node, ParseTreeContext context) { TypeHelper typeHelper = context.getTypeHelper(); // Checks whether the type of the dot node allows a navigation. Object type = node.getType(); if (!typeHelper.isEntityClass(type) && !typeHelper.isEmbeddable(type) && !typeHelper.isEnumType(type)) { throw JPQLException.invalidNavigation( context.getQueryInfo(), node.getLine(), node.getColumn(), this.getAsString(), node.getAsString(), typeHelper.getTypeName(type)); } // Special check to disallow collection valued relationships if (node.isDotNode()) { Node left = node.getLeft(); AttributeNode right = (AttributeNode)node.getRight(); if (typeHelper.isCollectionValuedRelationship( left.getType(), right.getAttributeName())) { throw JPQLException.invalidCollectionNavigation( context.getQueryInfo(), right.getLine(), right.getColumn(), this.getAsString(), right.getAttributeName()); } } }
/** * INTERNAL * Checks whether the left hand side of this dot node is navigable. */ private void checkNavigation(Node node, ParseTreeContext context) { TypeHelper typeHelper = context.getTypeHelper(); // Checks whether the type of the dot node allows a navigation. Object type = node.getType(); if (!typeHelper.isEntityClass(type) && !typeHelper.isEmbeddable(type) && !typeHelper.isEnumType(type)) { throw JPQLException.invalidNavigation( context.getQueryInfo(), node.getLine(), node.getColumn(), this.getAsString(), node.getAsString(), typeHelper.getTypeName(type)); } // Special check to disallow collection valued relationships if (node.isDotNode()) { Node left = node.getLeft(); AttributeNode right = (AttributeNode)node.getRight(); if (typeHelper.isCollectionValuedRelationship( left.getType(), right.getAttributeName())) { throw JPQLException.invalidCollectionNavigation( context.getQueryInfo(), right.getLine(), right.getColumn(), this.getAsString(), right.getAttributeName()); } } }
/** * INTERNAL * Checks whether the left hand side of this dot node is navigable. */ private void checkNavigation(Node node, ParseTreeContext context) { TypeHelper typeHelper = context.getTypeHelper(); // Checks whether the type of the dot node allows a navigation. Object type = node.getType(); if (!typeHelper.isEntityClass(type) && !typeHelper.isEmbeddable(type) && !typeHelper.isEnumType(type)) { throw JPQLException.invalidNavigation( context.getQueryInfo(), node.getLine(), node.getColumn(), this.getAsString(), node.getAsString(), typeHelper.getTypeName(type)); } // Special check to disallow collection valued relationships if (node.isDotNode()) { Node left = node.getLeft(); AttributeNode right = (AttributeNode)node.getRight(); if (typeHelper.isCollectionValuedRelationship( left.getType(), right.getAttributeName())) { throw JPQLException.invalidCollectionNavigation( context.getQueryInfo(), right.getLine(), right.getColumn(), this.getAsString(), right.getAttributeName()); } } }