Re: errors with derby and hsqldb (i need to switch from mysql to an embedded db)

From: Andrey Razumovsky (razumovsky.andre..mail.com)
Date: Fri Sep 19 2008 - 03:28:58 EDT

  • Next message: Andrey Razumovsky: "Re: errors with derby and hsqldb (i need to switch from mysql to an embedded db)"

    Hi Steave,

    ID is obviously not null following snapshot output (values={TITLE=asd,
    ID=200}), but ID is uppercase here, so when you use dataRow.get("id")
    it will return null. I think you must use uppercased "id", e.g.

    SQLTemplate template = new SQLTemplate(CayCanvass.class, "select *
    from Canvass c where c.ID = (select MAX(c.ID) from Canvass c)");

    Still, I do not know enough about Derby and HSQL to tell for sure why
    it happened.

    Hope that helps,
    Andrey

    2008/9/18, Steave <stefanonafet..mail.com>:
    > ps, no rows in Canvass have id column = null ,
    > and the table reflects the ddl written in my last mail
    >
    >
    > 2008/9/18 Steave <stefanonafet..mail.com>
    >
    >
    > > For schema, do you intend the db schema?
    > > If it is,
    > >
    > > well, this is the CREATE statement generated by modeler for hsqldb:
    > >
    > > CREATE CACHED TABLE Canvass (id BIGINT NOT NULL, title VARCHAR(150) NULL,
    > > PRIMARY KEY (id)
    > > ;
    > >
    > > In the modeler, both "Pk" and "Mandarory" are checked for id column.
    > >
    > >
    > > 2008/9/18 Scott Anderson <sanderso..irvana.com>
    > >
    > > > Null value for 'id'.
    > >>
    > >> Is id set to NULL in the schema, but MANDATORY in the Cayenne map? I'm
    > >> not sure if I'm interpreting the error correctly, but it sounds like
    > >> Cayenne sees a NULL where it doesn't expect one.
    > >>
    > >
    > >
    >



    This archive was generated by hypermail 2.0.0 : Fri Sep 19 2008 - 03:29:41 EDT