Queries on non-committed objects

From: Todd O'Bryan (toddobrya..ac.com)
Date: Sun Feb 05 2006 - 12:50:14 EST

  • Next message: Andrus Adamchik: "Re: Queries on non-committed objects"

    I'm getting a CayenneRuntimeException that just says QueryException.

    Here's the method that causes the problem:

    public List<ObQuestionDatum> getValues(int keyValue) {
                    SelectQuery q = new SelectQuery(ObQuestionDatum.class,
                                    ExpressionFactory.matchExp(ObQuestionDatum.QUESTION_PROPERTY,
    this).andExp(
                                    ExpressionFactory.matchExp(ObQuestionDatum.KEY_VALUE_PROPERTY,
    new Integer(keyValue))));
                    List<ObQuestionDatum> data = (List<ObQuestionDatum>) getDataContext
    ().performQuery(q);
                    return data;
            }

    Am I correct that the problem is that I can't do a query on objects
    that haven't been committed yet, or is there something else going on
    here? If I am correct that the problem is that the ObQuestionDatums
    that I'm looking for aren't in the database yet, can I use the getData
    () method from this class and go through each element to find the
    ones I'm interested in manually?

    TIA,
    Todd



    This archive was generated by hypermail 2.0.0 : Sun Feb 05 2006 - 12:50:35 EST