public Object getTypeForMapKey(ParseTreeContext context){ String name = getCanonicalVariableName(); if (context.isRangeVariable(name)) { throw JPQLException.variableCannotHaveMapKey(context.getQueryInfo(), getLine(), getColumn(), name); } else { DotNode path = (DotNode)context.pathForVariable(name); if (path == null) { throw JPQLException.aliasResolutionException( context.getQueryInfo(), getLine(), getColumn(), name); } else { return path.getTypeForMapKey(context); } } }
public Object getTypeForMapKey(ParseTreeContext context){ String name = getCanonicalVariableName(); if (context.isRangeVariable(name)) { throw JPQLException.variableCannotHaveMapKey(context.getQueryInfo(), getLine(), getColumn(), name); } else { DotNode path = (DotNode)context.pathForVariable(name); if (path == null) { throw JPQLException.aliasResolutionException( context.getQueryInfo(), getLine(), getColumn(), name); } else { return path.getTypeForMapKey(context); } } }
public Object getTypeForMapKey(ParseTreeContext context){ String name = getCanonicalVariableName(); if (context.isRangeVariable(name)) { throw JPQLException.variableCannotHaveMapKey(context.getQueryInfo(), getLine(), getColumn(), name); } else { DotNode path = (DotNode)context.pathForVariable(name); if (path == null) { throw JPQLException.aliasResolutionException( context.getQueryInfo(), getLine(), getColumn(), name); } else { return path.getTypeForMapKey(context); } } }
/** * resolveClass: Answer the class which corresponds to my variableName. This is the class for * an alias, where the variableName is registered to an alias. */ public Class resolveClass(GenerationContext generationContext) { Class clazz = null; String name = getCanonicalVariableName(); ParseTreeContext context = generationContext.getParseTreeContext(); if (context.isRangeVariable(name)) { String schema = context.schemaForVariable(name); clazz = context.classForSchemaName(schema, generationContext); } else { DotNode path = (DotNode)context.pathForVariable(name); if (path == null) { throw JPQLException.aliasResolutionException( context.getQueryInfo(), getLine(), getColumn(), name); } else { clazz = path.resolveClass(generationContext); } } return clazz; }
/** * resolveClass: Answer the class which corresponds to my variableName. This is the class for * an alias, where the variableName is registered to an alias. */ public Class resolveClass(GenerationContext generationContext) { Class clazz = null; String name = getCanonicalVariableName(); ParseTreeContext context = generationContext.getParseTreeContext(); if (context.isRangeVariable(name)) { String schema = context.schemaForVariable(name); clazz = context.classForSchemaName(schema, generationContext); } else { DotNode path = (DotNode)context.pathForVariable(name); if (path == null) { throw JPQLException.aliasResolutionException( context.getQueryInfo(), getLine(), getColumn(), name); } else { clazz = path.resolveClass(generationContext); } } return clazz; }
/** * resolveClass: Answer the class which corresponds to my variableName. This is the class for * an alias, where the variableName is registered to an alias. */ public Class resolveClass(GenerationContext generationContext) { Class clazz = null; String name = getCanonicalVariableName(); ParseTreeContext context = generationContext.getParseTreeContext(); if (context.isRangeVariable(name)) { String schema = context.schemaForVariable(name); clazz = context.classForSchemaName(schema, generationContext); } else { DotNode path = (DotNode)context.pathForVariable(name); if (path == null) { throw JPQLException.aliasResolutionException( context.getQueryInfo(), getLine(), getColumn(), name); } else { clazz = path.resolveClass(generationContext); } } return clazz; }
public Expression generateExpressionForAlias(GenerationContext context) { // BUG 3105651: Verify if we need to resolve this alias, or just use // an empty ExpressionBuilder. See OrderByItemNode.generateExpression() // for more details if (context.getParseTree().getQueryNode().isSelectNode() && context.shouldCheckSelectNodeBeforeResolving() && (((SelectNode)context.getParseTree().getQueryNode()).isSelected(this.getCanonicalVariableName()))) { return new ExpressionBuilder(); } Node nodeForAlias = getNodeForAlias(context); //assume that if there is no node available for the given variable, then //there must be an alias mismatch. Assume they know their attribute names better //than their alias names. - JGL if (nodeForAlias == null) { throw JPQLException.aliasResolutionException( context.getParseTreeContext().getQueryInfo(), getLine(), getColumn(), getVariableName()); } //create builder, and answer it return nodeForAlias.generateExpression(context); }
public Expression generateExpressionForAlias(GenerationContext context) { // BUG 3105651: Verify if we need to resolve this alias, or just use // an empty ExpressionBuilder. See OrderByItemNode.generateExpression() // for more details if (context.getParseTree().getQueryNode().isSelectNode() && context.shouldCheckSelectNodeBeforeResolving() && (((SelectNode)context.getParseTree().getQueryNode()).isSelected(this.getCanonicalVariableName()))) { return new ExpressionBuilder(); } Node nodeForAlias = getNodeForAlias(context); //assume that if there is no node available for the given variable, then //there must be an alias mismatch. Assume they know their attribute names better //than their alias names. - JGL if (nodeForAlias == null) { throw JPQLException.aliasResolutionException( context.getParseTreeContext().getQueryInfo(), getLine(), getColumn(), getVariableName()); } //create builder, and answer it return nodeForAlias.generateExpression(context); }
public Expression generateExpressionForAlias(GenerationContext context) { // BUG 3105651: Verify if we need to resolve this alias, or just use // an empty ExpressionBuilder. See OrderByItemNode.generateExpression() // for more details if (context.getParseTree().getQueryNode().isSelectNode() && context.shouldCheckSelectNodeBeforeResolving() && (((SelectNode)context.getParseTree().getQueryNode()).isSelected(this.getCanonicalVariableName()))) { return new ExpressionBuilder(); } Node nodeForAlias = getNodeForAlias(context); //assume that if there is no node available for the given variable, then //there must be an alias mismatch. Assume they know their attribute names better //than their alias names. - JGL if (nodeForAlias == null) { throw JPQLException.aliasResolutionException( context.getParseTreeContext().getQueryInfo(), getLine(), getColumn(), getVariableName()); } //create builder, and answer it return nodeForAlias.generateExpression(context); }
/** * INTERNAL * Validate node and calculate its type. */ public void validate(ParseTreeContext context) { TypeHelper typeHelper = context.getTypeHelper(); classConstant = typeHelper.resolveSchema(variableName); if (classConstant != null){ setType(Class.class); return; } String name = getCanonicalVariableName(); if (context.isRangeVariable(name)) { String schema = context.schemaForVariable(name); setType(typeHelper.resolveSchema(schema)); } else { Node path = context.pathForVariable(name); if (path == null) { throw JPQLException.aliasResolutionException( context.getQueryInfo(), getLine(), getColumn(), name); } else { setType(path.getType()); } } context.usedVariable(name); if (context.isDeclaredInOuterScope(name)) { context.registerOuterScopeVariable(name); } }
/** * INTERNAL * Validate node and calculate its type. */ public void validate(ParseTreeContext context) { TypeHelper typeHelper = context.getTypeHelper(); classConstant = typeHelper.resolveSchema(variableName); if (classConstant != null){ setType(Class.class); return; } String name = getCanonicalVariableName(); if (context.isRangeVariable(name)) { String schema = context.schemaForVariable(name); setType(typeHelper.resolveSchema(schema)); } else { Node path = context.pathForVariable(name); if (path == null) { throw JPQLException.aliasResolutionException( context.getQueryInfo(), getLine(), getColumn(), name); } else { setType(path.getType()); } } context.usedVariable(name); if (context.isDeclaredInOuterScope(name)) { context.registerOuterScopeVariable(name); } }
/** * INTERNAL * Validate node and calculate its type. */ public void validate(ParseTreeContext context) { TypeHelper typeHelper = context.getTypeHelper(); classConstant = typeHelper.resolveSchema(variableName); if (classConstant != null){ setType(Class.class); return; } String name = getCanonicalVariableName(); if (context.isRangeVariable(name)) { String schema = context.schemaForVariable(name); setType(typeHelper.resolveSchema(schema)); } else { Node path = context.pathForVariable(name); if (path == null) { throw JPQLException.aliasResolutionException( context.getQueryInfo(), getLine(), getColumn(), name); } else { setType(path.getType()); } } context.usedVariable(name); if (context.isDeclaredInOuterScope(name)) { context.registerOuterScopeVariable(name); } }
throw JPQLException.aliasResolutionException( context.getQueryInfo(), leftMost.getLine(), leftMost.getColumn(), leftMost.getAsString());
throw JPQLException.aliasResolutionException( context.getQueryInfo(), leftMost.getLine(), leftMost.getColumn(), leftMost.getAsString());
throw JPQLException.aliasResolutionException( context.getQueryInfo(), leftMost.getLine(), leftMost.getColumn(), leftMost.getAsString());