cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrey Razumovsky" <razumovsky.and...@gmail.com>
Subject Re: errors with derby and hsqldb (i need to switch from mysql to an embedded db)
Date Fri, 19 Sep 2008 07:28:58 GMT
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 <stefanonafets@gmail.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 <stefanonafets@gmail.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 <sanderson@airvana.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.
>  >>
>  >
>  >
>

Mime
View raw message