1 10 11 package com.triactive.jdo.store; 12 13 import javax.jdo.JDOFatalInternalException; 14 15 16 22 23 class SubquerySetExpression extends SetExpression 24 { 25 private final QueryStatement subquery; 26 27 28 public SubquerySetExpression(QueryStatement qs, QueryStatement subquery) 29 { 30 super(qs); 31 32 this.subquery = subquery; 33 34 if (subquery.columnsSelected() != 1) 35 throw new JDOFatalInternalException("Cannot use as set expression, # of selected columns != 1: " + subquery); 36 37 st.append("(").append(subquery.toStatementText()).append(')'); 38 } 39 40 41 public BooleanExpression containsMethod(SQLExpression expr) 42 { 43 return expr.in(this); 44 } 45 46 47 public BooleanExpression isEmptyMethod() 48 { 49 return new ExistsExpression(qs, subquery, false); 50 } 51 } 52 | Popular Tags |