Re: Queries on non-committed objects

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Sun Feb 05 2006 - 15:24:25 EST

  • Next message: Todd O'Bryan: "Re: Queries on non-committed objects"

    Todd,

    You need to post the stack trace. It is not clear where the exception
    happens.

    Andrus

    On Feb 5, 2006, at 12:50 PM, Todd O'Bryan wrote:

    > 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 - 15:24:28 EST