SQLTemplate & HSQLDB question

From: Steve Lorimer (lorimer.stev..mail.com)
Date: Wed Jan 25 2006 - 17:37:18 EST

  • Next message: Cris Daniluk: "Re: SQLTemplate & HSQLDB question"

    Hello all,

    I am trying to add HSQLDB support to my application using Cayenne. I'm
    successfully using MySQL 5 with Cayenne.

    Here's the code segment:
         SQLTemplate query2 = new SQLTemplate(Contact.class, queryString, true);
         people = new DataObjectList(dataContext.performQuery(query2));

    A couple of notes. First, this all works correctly when using MySQL as the
    db engine. (Yes, I've tried the latest Cayenne & Hsqldb jars). Second, if I
    use a SelectQuery with Hsqldb, it works fine and returns all the fields.
    However, I have to use SQLTemplate queries. For some reason, it seems that
    Cayenne is not getting the record_id data back, but this only occurs when
    using the SQLTemplate & Hsqldb. I would be grateful for any help. Thanks,
    Steve.

    Here's the debug info:
    INFO QueryLogger: --- transaction started.
    INFO QueryLogger: SELECT * FROM Contact WHERE last_name like 'l%'
    INFO QueryLogger: === returned 1 row. - took 47 ms.
    INFO QueryLogger: +++ transaction committed.
    org.objectstyle.cayenne.CayenneRuntimeException: [v.1.2M10 January 5 2006]
    Null value for 'record_id'. Snapshot:
    org.objectstyle.cayenne.DataRo..0c6cfc[version=-9223372036854775807,
    replaces=-9223372036854775808, values={SPOUSE_FIRST_NAME=Melissa, STATE=,
    HOME_CHURCH=, DENOMINATION=0, ZIPCODE=, VOLUNTEER_INTEREST=false,
    VOLUNTEER_AREAS=, FAX=, CONTACT_SOURCE=0, RECORD_MODIFIED_BY=Test User,
    DONOR_TYPE=2, MARITAL_STATUS=0, CONTACT_FLAGS=, PHOTO_DATE=null, EMAIL2=,
    PHONE1=, GREETING_FORMAL=Mr. & Mrs. Steve Lorimer, RECORD_LOCATION=0,
    RECORD_ID=0, SPOUSE_LAST_NAME=, CONTACT_DETAILS=, VOLUNTEER_COMMENTS=,
    ADDRESS2=, COUNTRY=, GREETING_INFORMAL=Steve & Melissa, GROUP_AFFILIATION=,
    DECEASED=false, ANNIVERSARY_DATE=null, VOLUNTEER_SKILLS=, EMAIL1=,
    SPOUSE_DECEASED=false, SPOUSE_BIRTH_DATE=null, PHONE2=, RECORD_STATE=true,
    ORGANIZATION_NAME=, LAST_NAME=Lorimer, RECORD_CREATION_BY=Test User,
    RECORD_MODIFIED_DATE=Wed Jan 25 00:00:00 EST 2006, FIRST_NAME=Steve, CITY=,
    ALUMNI=false, ADDRESS1=, BIRTH_DATE=Wed Jan 25 00:00:00 EST 2006,
    CONTACT_LISTS=, RETIRED=false, RECORD_CREATION_DATE=Wed Jan 25 00:00:00 EST
    2006}]. Prefix: null
        at org.objectstyle.cayenne.DataRow.createObjectId(DataRow.java:238)
        at org.objectstyle.cayenne.DataRow.createObjectId(DataRow.java:193)
        at org.objectstyle.cayenne.DataRow.createObjectId(DataRow.java:167)
        at org.objectstyle.cayenne.access.ObjectResolver.objectFromDataRow(
    ObjectResolver.java:231)
        at org.objectstyle.cayenne.access.ObjectResolver.objectsFromDataRows(
    ObjectResolver.java:149)
        at
    org.objectstyle.cayenne.access.ObjectResolver.synchronizedObjectsFromDataRows
    (ObjectResolver.java:128)
        at
    org.objectstyle.cayenne.access.DataContextSelectAction.getResultsAsObjects(
    DataContextSelectAction.java:218)
        at org.objectstyle.cayenne.access.DataContextSelectAction.performQuery(
    DataContextSelectAction.java:181)
        at org.objectstyle.cayenne.access.DataContextSelectAction.performQuery(
    DataContextSelectAction.java:93)
        at org.objectstyle.cayenne.access.DataContext.performQuery(
    DataContext.java:1200)
        at org.kmbc.konnections.ui.KeyFrameController.performContactQuery(
    KeyFrameController.java:1540)
        at org.kmbc.konnections.ui.KeyFrameController.connectAction(
    KeyFrameController.java:871)
        at
    org.kmbc.konnections.ui.actions.LoginScreenWithStatusBar$1.actionPerformed(
    LoginScreenWithStatusBar.java:100)

    ReplyForward

     MAILER-DAEMO..ensk.objectstyle.org to me
     More options 5:32 pm (3 minutes ago)
    Hi. This is the qmail-send program at mensk.objectstyle.org.
    I'm afraid I wasn't able to deliver your message to the following addresses.
    This is a permanent error; I've given up. Sorry it didn't work out.

    <cayenne-use..bjectstyle.org>:
    Sorry, you are not allowed to post to this list.

    --- Below this line is a copy of the message.

    Return-Path: <lorimer.stev..mail.com>
    Received: (qmail 27025 invoked from network); 25 Jan 2006 22:32:55 -0000
    Received: from zproxy.gmail.com (64.233.162.204)
     by mensk.objectstyle.org with SMTP; 25 Jan 2006 22:32:55 -0000
    Received: by zproxy.gmail.com with SMTP id 40so219855nzk
           for <cayenne-use..bjectstyle.org>; Wed, 25 Jan 2006 14:32:55 -0800
    (PST)
    DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws;
           s=beta; d=gmail.com;
           h=received:message-id:date
    :from:to:subject:mime-version:content-type;
           b=P5u9UFWwJ9nqOGPb7hx1HQKkmPIM
    0Th9R/JFThqtITYHzuPVpyNSFXSIyYBzI6JtwuNKQhwa9m1Y8H7UnzrOERJv3HgAL3EL7hc6xiz+yTJACTDZ3dcEr5GW5CMKxtEAfuB/hF+bp+/7HEam999ZheNiJpIC6Yk0ybCm066Dp5s=
    Received: by 10.36.115.2 with SMTP id n2mr908310nzc;
           Wed, 25 Jan 2006 14:32:54 -0800 (PST)
    Received: by 10.36.120.18 with HTTP; Wed, 25 Jan 2006 14:32:54 -0800 (PST)
    Message-ID: <a47078b60601251432g1d76a871r4417ebd417438a2..ail.gmail.com>
    Date: Wed, 25 Jan 2006 17:32:54 -0500
    From: Steve Lorimer <lorimer.stev..mail.com>
    To: cayenne-use..bjectstyle.org
    Subject: SQLTemplate & HSQLDB question
    MIME-Version: 1.0
    Content-Type: multipart/alternative;
           boundary="----=_Part_21017_11319165.1138228374951"

    ------=_Part_21017_11319165.1138228374951
    Content-Type: text/plain; charset=ISO-8859-1
    Content-Transfer-Encoding: quoted-printable
    Content-Disposition: inline

    Hello all,

    I am trying to add HSQLDB support to my application using Cayenne. I'm
    successfully using MySQL 5 with Cayenne.

    Here's the code segment:
        SQLTemplate query2 =3D new SQLTemplate(Contact.class, queryString, tru=
    e);
        people =3D new DataObjectList(dataContext.performQuery(query2));

    A couple of notes. First, this all works correctly when using MySQL as the
    db engine. (Yes, I've tried the latest Cayenne & Hsqldb jars). Second, if =
    I
    use a SelectQuery with Hsqldb, it works fine and returns all the fields.
    However, I have to use SQLTemplate queries. For some reason, it seems that
    Cayenne is not getting the record_id data back, but this only occurs when
    using the SQLTemplate & Hsqldb. I would be grateful for any help. Thanks,
    Steve.

    Here's the debug info:
    INFO QueryLogger: --- transaction started.
    INFO QueryLogger: SELECT * FROM Contact WHERE last_name like 'l%'
    INFO QueryLogger: =3D=3D=3D returned 1 row. - took 47 ms.
    INFO QueryLogger: +++ transaction committed.
    org.objectstyle.cayenne.CayenneRuntimeException: [v.1.2M10 January 5 2006]
    Null value for 'record_id'. Snapshot:
    org.objectstyle.cayenne.DataRo..0c6cfc[version=3D-9223372036854775807,
    replaces=3D-9223372036854775808, values=3D{SPOUSE_FIRST_NAME=3DMelissa, STA=
    TE=3D,
    HOME_CHURCH=3D, DENOMINATION=3D0, ZIPCODE=3D, VOLUNTEER_INTEREST=3Dfalse,
    VOLUNTEER_AREAS=3D, FAX=3D, CONTACT_SOURCE=3D0, RECORD_MODIFIED_BY=3DTest U=
    ser,
    DONOR_TYPE=3D2, MARITAL_STATUS=3D0, CONTACT_FLAGS=3D, PHOTO_DATE=3Dnull, EM=
    AIL2=3D,
    PHONE1=3D, GREETING_FORMAL=3DMr. & Mrs. Steve Lorimer, RECORD_LOCATION=3D0,
    RECORD_ID=3D0, SPOUSE_LAST_NAME=3D, CONTACT_DETAILS=3D, VOLUNTEER_COMMENTS=
    =3D,
    ADDRESS2=3D, COUNTRY=3D, GREETING_INFORMAL=3DSteve & Melissa, GROUP_AFFILIA=
    TION=3D,
    DECEASED=3Dfalse, ANNIVERSARY_DATE=3Dnull, VOLUNTEER_SKILLS=3D, EMAIL1=3D,
    SPOUSE_DECEASED=3Dfalse, SPOUSE_BIRTH_DATE=3Dnull, PHONE2=3D, RECORD_STATE=
    =3Dtrue,
    ORGANIZATION_NAME=3D, LAST_NAME=3DLorimer, RECORD_CREATION_BY=3DTest User,
    RECORD_MODIFIED_DATE=3DWed Jan 25 00:00:00 EST 2006, FIRST_NAME=3DSteve, CI=
    TY=3D,
    ALUMNI=3Dfalse, ADDRESS1=3D, BIRTH_DATE=3DWed Jan 25 00:00:00 EST 2006,
    CONTACT_LISTS=3D, RETIRED=3Dfalse, RECORD_CREATION_DATE=3DWed Jan 25 00:00:=
    00 EST
    2006}]. Prefix: null
       at org.objectstyle.cayenne.DataRow.createObjectId(DataRow.java:238)
       at org.objectstyle.cayenne.DataRow.createObjectId(DataRow.java:193)
       at org.objectstyle.cayenne.DataRow.createObjectId(DataRow.java:167)
       at org.objectstyle.cayenne.access.ObjectResolver.objectFromDataRow(
    ObjectResolver.java:231)
       at org.objectstyle.cayenne.access.ObjectResolver.objectsFromDataRows(
    ObjectResolver.java:149)
       at
    org.objectstyle.cayenne.access.ObjectResolver.synchronizedObjectsFromDataRo=
    ws
    (ObjectResolver.java:128)
       at
    org.objectstyle.cayenne.access.DataContextSelectAction.getResultsAsObjects(
    DataContextSelectAction.java:218)
       at org.objectstyle.cayenne.access.DataContextSelectAction.performQuery(
    DataContextSelectAction.java:181)
       at org.objectstyle.cayenne.access.DataContextSelectAction.performQuery(
    DataContextSelectAction.java:93)
       at org.objectstyle.cayenne.access.DataContext.performQuery(
    DataContext.java:1200)
       at org.kmbc.konnections.ui.KeyFrameController.performContactQuery(
    KeyFrameController.java:1540)
       at org.kmbc.konnections.ui.KeyFrameController.connectAction(
    KeyFrameController.java:871)
       at
    org.kmbc.konnections.ui.actions.LoginScreenWithStatusBar$1.actionPerformed(
    LoginScreenWithStatusBar.java:100)



    This archive was generated by hypermail 2.0.0 : Wed Jan 25 2006 - 17:37:21 EST