buffer.append("false"); } else { String bagTableName = state.getBagTableNames().get(c); if (filteredBag.size() < MAX_BAG_INLINE_SIZE || bagTableName == null) { buffer.append("(");
buffer.append("false"); } else { String bagTableName = state.getBagTableNames().get(c); if (filteredBag.size() < MAX_BAG_INLINE_SIZE || bagTableName == null) { buffer.append("(");
QUERY_SUBQUERY_CONSTRAINT, state.getBagTableNames())); } else { if ((disjunctive && completelyFalse(subC))
(c.getOp() == ConstraintOp.CONTAINS ? ConstraintOp.IN : ConstraintOp.NOT_IN), arg1Qcb.getIds()); state.getBagTableNames().put(bagCon, state.getBagTableNames().get( arg1Qcb)); bagConstraintToString(state, buffer, bagCon, q, schema, (c.getOp() == ConstraintOp.CONTAINS ? ConstraintOp.IN : ConstraintOp.NOT_IN), arg1Qcb.getIds()); state.getBagTableNames().put(bagCon, state.getBagTableNames().get( arg1Qcb)); bagConstraintToString(state, buffer, bagCon, q, schema, (c.getOp() == ConstraintOp.CONTAINS ? ConstraintOp.IN : ConstraintOp.NOT_IN), arg1Qcb.getIds()); state.getBagTableNames().put(bagCon, state.getBagTableNames().get( arg1Qcb)); bagConstraintToString(state, buffer, bagCon, q, schema,
(c.getOp() == ConstraintOp.CONTAINS ? ConstraintOp.IN : ConstraintOp.NOT_IN), arg1Qcb.getIds()); state.getBagTableNames().put(bagCon, state.getBagTableNames().get( arg1Qcb)); bagConstraintToString(state, buffer, bagCon, q, schema, (c.getOp() == ConstraintOp.CONTAINS ? ConstraintOp.IN : ConstraintOp.NOT_IN), arg1Qcb.getIds()); state.getBagTableNames().put(bagCon, state.getBagTableNames().get( arg1Qcb)); bagConstraintToString(state, buffer, bagCon, q, schema, (c.getOp() == ConstraintOp.CONTAINS ? ConstraintOp.IN : ConstraintOp.NOT_IN), arg1Qcb.getIds()); state.getBagTableNames().put(bagCon, state.getBagTableNames().get( arg1Qcb)); bagConstraintToString(state, buffer, bagCon, q, schema,
buffer.append(c.getOp() == ConstraintOp.IN ? "false" : "true"); } else { String bagTableName = state.getBagTableNames().get(c); if (filteredBag.size() < MAX_BAG_INLINE_SIZE || bagTableName == null) { int needComma = 0;
buffer.append(c.getOp() == ConstraintOp.IN ? "false" : "true"); } else { String bagTableName = state.getBagTableNames().get(c); if (filteredBag.size() < MAX_BAG_INLINE_SIZE || bagTableName == null) { int needComma = 0;
QUERY_SUBQUERY_CONSTRAINT, state.getBagTableNames())); } else { if ((disjunctive && completelyFalse(subC))
/** * Converts a SubqueryConstraint object into a String suitable for putting in an SQL query. * * @param state the current SqlGenerator state * @param buffer the StringBuffer to place text into * @param c the SubqueryConstraint object * @param q the Query * @param schema the DatabaseSchema in which to look up metadata * @throws ObjectStoreException if something goes wrong */ protected static void subqueryConstraintToString(State state, StringBuffer buffer, SubqueryConstraint c, Query q, DatabaseSchema schema) throws ObjectStoreException { Query subQ = c.getQuery(); QueryEvaluable qe = c.getQueryEvaluable(); QueryClass cls = c.getQueryClass(); if (qe != null) { queryEvaluableToString(buffer, qe, q, state); } else { queryClassToString(buffer, cls, q, schema, QUERY_SUBQUERY_CONSTRAINT, state); } buffer.append(" " + c.getOp().toString() + " (" + generate(subQ, schema, state.getDb(), null, QUERY_SUBQUERY_CONSTRAINT, state.getBagTableNames()) + ")"); }
/** * Converts a SubqueryConstraint object into a String suitable for putting in an SQL query. * * @param state the current SqlGenerator state * @param buffer the StringBuffer to place text into * @param c the SubqueryConstraint object * @param q the Query * @param schema the DatabaseSchema in which to look up metadata * @throws ObjectStoreException if something goes wrong */ protected static void subqueryConstraintToString(State state, StringBuffer buffer, SubqueryConstraint c, Query q, DatabaseSchema schema) throws ObjectStoreException { Query subQ = c.getQuery(); QueryEvaluable qe = c.getQueryEvaluable(); QueryClass cls = c.getQueryClass(); if (qe != null) { queryEvaluableToString(buffer, qe, q, state); } else { queryClassToString(buffer, cls, q, schema, QUERY_SUBQUERY_CONSTRAINT, state); } buffer.append(" " + c.getOp().toString() + " (" + generate(subQ, schema, state.getDb(), null, QUERY_SUBQUERY_CONSTRAINT, state.getBagTableNames()) + ")"); }
/** * Converts a SubqueryExistsConstraint object into a String suitable for putting in an SQL * query. * * @param state the current SqlGenerator state * @param buffer the StringBuffer to place text into * @param c the SubqueryExistsConstraint object * @param schema the DatabaseSchema in which to look up metadata * @throws ObjectStoreException if something goes wrong */ protected static void subqueryExistsConstraintToString(State state, StringBuffer buffer, SubqueryExistsConstraint c, DatabaseSchema schema) throws ObjectStoreException { Query subQ = c.getQuery(); buffer.append((c.getOp() == ConstraintOp.EXISTS ? "EXISTS(" : "(NOT EXISTS(") + generate(subQ, schema, state.getDb(), null, QUERY_SUBQUERY_EXISTS, state.getBagTableNames()) + (c.getOp() == ConstraintOp.EXISTS ? ")" : "))")); }
/** * Converts a SubqueryExistsConstraint object into a String suitable for putting in an SQL * query. * * @param state the current SqlGenerator state * @param buffer the StringBuffer to place text into * @param c the SubqueryExistsConstraint object * @param schema the DatabaseSchema in which to look up metadata * @throws ObjectStoreException if something goes wrong */ protected static void subqueryExistsConstraintToString(State state, StringBuffer buffer, SubqueryExistsConstraint c, DatabaseSchema schema) throws ObjectStoreException { Query subQ = c.getQuery(); buffer.append((c.getOp() == ConstraintOp.EXISTS ? "EXISTS(" : "(NOT EXISTS(") + generate(subQ, schema, state.getDb(), null, QUERY_SUBQUERY_EXISTS, state.getBagTableNames()) + (c.getOp() == ConstraintOp.EXISTS ? ")" : "))")); }