/** * Return the selection criteria for the statement. */ public Expression getSelectionCriteria() { return getSQLStatement().getWhereClause(); }
/** * INTERNAL: * Return a call built from a statement. Subclasses may throw an exception * if the statement is not appropriate. */ public DatasourceCall buildCallFromStatement(SQLStatement statement, DatabaseQuery query, AbstractSession session) { DatabaseCall call = statement.buildCall(session); if (isNativeConnectionRequired()) { call.setIsNativeConnectionRequired(true); } return call; }
/** * Clone the mechanism for the specified query clone. */ public DatabaseQueryMechanism clone(DatabaseQuery queryClone) { StatementQueryMechanism clone = (StatementQueryMechanism)super.clone(queryClone); if ((!hasMultipleStatements()) && (getSQLStatement() != null)) { clone.setSQLStatement((SQLStatement)sqlStatement.clone()); } else { Vector currentStatements = getSQLStatements(); if (currentStatements != null) { Vector statementClone = org.eclipse.persistence.internal.helper.NonSynchronizedVector.newInstance(currentStatements.size()); Enumeration enumtr = currentStatements.elements(); while (enumtr.hasMoreElements()) { statementClone.addElement(((SQLStatement)enumtr.nextElement()).clone()); } clone.setSQLStatements(statementClone); } } return clone; }
/** * PUBLIC: * Sets the selection criteria to be used as a where clause to read * reference objects. This criteria is automatically generated by the * TopLink if not explicitly specified by the user. */ @Override public void setSelectionCriteria(Expression anExpression) { if (getSelectionQuery().isReadAllQuery()){ ((ReadAllQuery)getSelectionQuery()).setSelectionCriteria(anExpression); } else { getSelectionQuery().getSQLStatement().setWhereClause(anExpression); } }
/** * INTERNAL: * Return the base expression to use for adding fields to the query. * This is the reference table. */ @Override protected Expression getAdditionalFieldsBaseExpression(ReadQuery query) { if (query.isReadAllQuery()) { return ((ReadAllQuery)query).getExpressionBuilder(); } else { return ((DataReadQuery)query).getSQLStatement().getBuilder().getTable(getReferenceTable()); } }
/** * PUBLIC: * Sets the selection criteria to be used as a where clause to read * reference objects. This criteria is automatically generated by the * TopLink if not explicitly specified by the user. */ @Override public void setSelectionCriteria(Expression anExpression) { if (getSelectionQuery().isReadAllQuery()){ ((ReadAllQuery)getSelectionQuery()).setSelectionCriteria(anExpression); } else { getSelectionQuery().getSQLStatement().setWhereClause(anExpression); } }
/** * INTERNAL: * Return the base expression to use for adding fields to the query. * This is the reference table. */ @Override protected Expression getAdditionalFieldsBaseExpression(ReadQuery query) { if (query.isReadAllQuery()) { return ((ReadAllQuery)query).getExpressionBuilder(); } else { return ((DataReadQuery)query).getSQLStatement().getBuilder().getTable(getReferenceTable()); } }
/** * Return the selection criteria for the statement. */ public Expression getSelectionCriteria() { return getSQLStatement().getWhereClause(); }
/** * INTERNAL: * Return a call built from a statement. Subclasses may throw an exception * if the statement is not appropriate. */ public DatasourceCall buildCallFromStatement(SQLStatement statement, DatabaseQuery query, AbstractSession session) { DatabaseCall call = statement.buildCall(session); if (isNativeConnectionRequired()) { call.setIsNativeConnectionRequired(true); } return call; }
/** * PUBLIC: * Sets the selection criteria to be used as a where clause to read * reference objects. This criteria is automatically generated by the * TopLink if not explicitly specified by the user. */ public void setSelectionCriteria(Expression anExpression) { if (getSelectionQuery().isReadAllQuery()){ ((ReadAllQuery)getSelectionQuery()).setSelectionCriteria(anExpression); } else { getSelectionQuery().getSQLStatement().setWhereClause(anExpression); } } /**
/** * Clone the mechanism for the specified query clone. */ public DatabaseQueryMechanism clone(DatabaseQuery queryClone) { StatementQueryMechanism clone = (StatementQueryMechanism)super.clone(queryClone); if ((!hasMultipleStatements()) && (getSQLStatement() != null)) { clone.setSQLStatement((SQLStatement)sqlStatement.clone()); } else { Vector currentStatements = getSQLStatements(); if (currentStatements != null) { Vector statementClone = org.eclipse.persistence.internal.helper.NonSynchronizedVector.newInstance(currentStatements.size()); Enumeration enumtr = currentStatements.elements(); while (enumtr.hasMoreElements()) { statementClone.addElement(((SQLStatement)enumtr.nextElement()).clone()); } clone.setSQLStatements(statementClone); } } return clone; }
/** * Return the selection criteria for the statement. */ public Expression getSelectionCriteria() { return getSQLStatement().getWhereClause(); }
/** * INTERNAL: * Return a call built from a statement. Subclasses may throw an exception * if the statement is not appropriate. */ public DatabaseCall buildCallFromStatement(SQLStatement statement, AbstractSession session) { DatabaseCall call = statement.buildCall(session); if (isNativeConnectionRequired()) { call.setIsNativeConnectionRequired(true); } return call; }
/** * Clone the mechanism for the specified query clone. */ public DatabaseQueryMechanism clone(DatabaseQuery queryClone) { StatementQueryMechanism clone = (StatementQueryMechanism)super.clone(queryClone); if ((!hasMultipleStatements()) && (getSQLStatement() != null)) { clone.setSQLStatement((SQLStatement)sqlStatement.clone()); } else { Vector currentStatements = getSQLStatements(); if (currentStatements != null) { Vector statementClone = org.eclipse.persistence.internal.helper.NonSynchronizedVector.newInstance(currentStatements.size()); Enumeration enumtr = currentStatements.elements(); while (enumtr.hasMoreElements()) { statementClone.addElement(((SQLStatement)enumtr.nextElement()).clone()); } clone.setSQLStatements(statementClone); } } return clone; }
if (statement.getWhereClause() != null) { appendExpressionToQueryRow(statement.getWhereClause(), row, query);
/** * Try to print the SQL. */ public String toString() { StringWriter writer = new StringWriter(); writer.write(Helper.getShortClassName(getClass())); writer.write("("); try { DatabaseCall call = buildCall(new DatabaseSessionImpl(new org.eclipse.persistence.sessions.DatabaseLogin())); writer.write(call.getSQLString()); } catch (Exception exception) { } writer.write(")"); return writer.toString(); } }
twisted = builder.twist(getSelectionQuery().getSelectionCriteria(), builder); } else { twisted = builder.twist(getSelectionQuery().getSQLStatement().getWhereClause(), builder);
/** * Try to print the SQL. */ public String toString() { StringWriter writer = new StringWriter(); writer.write(Helper.getShortClassName(getClass())); writer.write("("); try { DatabaseCall call = buildCall(new DatabaseSessionImpl(new org.eclipse.persistence.sessions.DatabaseLogin())); writer.write(call.getSQLString()); } catch (Exception exception) { } writer.write(")"); return writer.toString(); } }
batchSelectionCriteria = builder.twist(this.selectionQuery.getSelectionCriteria(), builder); } else { batchSelectionCriteria = builder.twist(this.selectionQuery.getSQLStatement().getWhereClause(), builder);
/** * Try to print the SQL. */ public String toString() { StringWriter writer = new StringWriter(); writer.write(Helper.getShortClassName(getClass())); writer.write("("); try { DatabaseCall call = buildCall(new DatabaseSessionImpl(new org.eclipse.persistence.sessions.DatabaseLogin())); writer.write(call.getSQLString()); } catch (Exception exception) { } writer.write(")"); return writer.toString(); } }