Re: Queries on non-committed objects

From: Todd O'Bryan (toddobrya..ac.com)
Date: Sun Feb 05 2006 - 15:28:05 EST

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

    Sorry about that. It's the line before the return statement at the
    performQuery(q). Here's the part of the trace above that:

    org.objectstyle.cayenne.access.QueryResult.nextQueryException
    (QueryResult.java:257)
    org.objectstyle.cayenne.access.DataDomainQueryAction.nextQueryException(
    DataDomainQueryAction.java:176)
    org.objectstyle.cayenne.access.DataNode.performQueries(DataNode.java:
    328)
    org.objectstyle.cayenne.access.DataDomainQueryAction.performQuery
    (DataDomainQueryAction.java:107)
    org.objectstyle.cayenne.access.DataDomain.performQueries
    (DataDomain.java:643)
    org.objectstyle.cayenne.access.DataContext.performQueries
    (DataContext.java:1100)
    org.objectstyle.cayenne.access.Transaction.performQueries
    (Transaction.java:207)
    org.objectstyle.cayenne.access.DataContext.performQueries
    (DataContext.java:1068)
    org.objectstyle.cayenne.access.DataContextSelectAction.performQuery
    (DataContextSelectAction.java:173)
    org.objectstyle.cayenne.access.DataContextSelectAction.performQuery
    (DataContextSelectAction.java:93)
    org.objectstyle.cayenne.access.DataContext.performQuery
    (DataContext.java:1200)
    org.dupontmanual.cayenne.neogrades.ObQuestion.getValues
    (ObQuestion.java:35)

    Thanks!
    Todd

    On Feb 5, 2006, at 3:24 PM, Andrus Adamchik wrote:

    > 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:28:20 EST