/** * INTERNAL * Generate the a new EclipseLink TableEntryExpression for this node. */ public Expression generateExpression(GenerationContext context) { LinkedHashMap whenClauseMap = new LinkedHashMap(whenClauses.size()); Iterator i = whenClauses.iterator(); while (i.hasNext()){ WhenThenNode clause = (WhenThenNode)i.next(); whenClauseMap.put(clause.generateExpressionForWhen(context), clause.generateExpressionForThen(context)); } Expression whereClause = null; if (getLeft() == null){ whereClause = context.getBaseExpression().caseStatement(whenClauseMap, getRight().generateExpression(context)); } else { whereClause = getLeft().generateExpression(context).caseStatement(whenClauseMap, getRight().generateExpression(context)); } return whereClause; }
/** * INTERNAL * Generate the a new EclipseLink TableEntryExpression for this node. */ public Expression generateExpression(GenerationContext context) { LinkedHashMap whenClauseMap = new LinkedHashMap(whenClauses.size()); Iterator i = whenClauses.iterator(); while (i.hasNext()){ WhenThenNode clause = (WhenThenNode)i.next(); whenClauseMap.put(clause.generateExpressionForWhen(context), clause.generateExpressionForThen(context)); } Expression whereClause = null; if (getLeft() == null){ whereClause = context.getBaseExpression().caseStatement(whenClauseMap, getRight().generateExpression(context)); } else { whereClause = getLeft().generateExpression(context).caseStatement(whenClauseMap, getRight().generateExpression(context)); } return whereClause; }
/** * INTERNAL * Generate the a new EclipseLink TableEntryExpression for this node. */ public Expression generateExpression(GenerationContext context) { LinkedHashMap whenClauseMap = new LinkedHashMap(whenClauses.size()); Iterator i = whenClauses.iterator(); while (i.hasNext()){ WhenThenNode clause = (WhenThenNode)i.next(); whenClauseMap.put(clause.generateExpressionForWhen(context), clause.generateExpressionForThen(context)); } Expression whereClause = null; if (getLeft() == null){ whereClause = context.getBaseExpression().caseStatement(whenClauseMap, getRight().generateExpression(context)); } else { whereClause = getLeft().generateExpression(context).caseStatement(whenClauseMap, getRight().generateExpression(context)); } return whereClause; }
public void validate(ParseTreeContext context) { TypeHelper typeHelper = context.getTypeHelper(); if (left != null){ left.validate(context); } right.validate(context); Iterator i = whenClauses.iterator(); Object type = null; while (i.hasNext()){ Node node = ((Node)i.next()); node.validate(context); if (type == null){ type = node.getType(); } else if (!type.equals(node.getType())){ type = Object.class; } } if (getRight().getType() != type){ type = typeHelper.getObjectType(); } setType(type); }
public void validate(ParseTreeContext context) { TypeHelper typeHelper = context.getTypeHelper(); if (left != null){ left.validate(context); } right.validate(context); Iterator i = whenClauses.iterator(); Object type = null; while (i.hasNext()){ Node node = ((Node)i.next()); node.validate(context); if (type == null){ type = node.getType(); } else if (!type.equals(node.getType())){ type = Object.class; } } if (getRight().getType() != type){ type = typeHelper.getObjectType(); } setType(type); }
public void validate(ParseTreeContext context) { TypeHelper typeHelper = context.getTypeHelper(); if (left != null){ left.validate(context); } right.validate(context); Iterator i = whenClauses.iterator(); Object type = null; while (i.hasNext()){ Node node = ((Node)i.next()); node.validate(context); if (type == null){ type = node.getType(); } else if (!type.equals(node.getType())){ type = Object.class; } } if (getRight().getType() != type){ type = typeHelper.getObjectType(); } setType(type); }