1 21 package oracle.toplink.essentials.internal.parsing; 23 24 25 import oracle.toplink.essentials.expressions.*; 27 28 37 public class EmptyCollectionComparisonNode extends SimpleConditionalExpressionNode { 38 public boolean notIndicated = false; 39 40 43 public EmptyCollectionComparisonNode() { 44 super(); 45 } 46 47 51 public void validate(ParseTreeContext context) { 52 if (left != null) { 53 left.validate(context); 54 } 55 TypeHelper typeHelper = context.getTypeHelper(); 56 setType(typeHelper.getBooleanType()); 57 } 58 59 63 public Expression generateExpression(GenerationContext context) { 64 String emptyAttributeName = ((AttributeNode)getLeft().getRight()).getAttributeName(); 67 Expression whereClause = getLeft().getLeft().generateExpression(context); 68 if (notIndicated) { 69 return whereClause.notEmpty(emptyAttributeName); 70 } else { 71 return whereClause.isEmpty(emptyAttributeName); 72 } 73 } 74 75 81 public void indicateNot() { 82 notIndicated = true; 83 } 84 85 } 86 | Popular Tags |