Hi Martin,
Let me jump in on that.
martin ruff writes:
> Hi Craig,
> I FOUND the mistake !!!!
> it was a proplem in the datamap:
> all other object entities have a primary key definition:
> (I got those by reverse engineering the database)
> id integer PK mandatory maxlength 4
>
> projects had:
> id numeric PK mandatory
>
> now I changed it to:
> id integer PK mandatory maxlength 4
>
> and now it works:
> (Projects)theDataContext.registeredObject(new ObjectId(Projects.class,
> "id",projectsID.intValue()));
> now returns me a correct Projects object
Hmm, strange. What database are you using (you may have mentioned this
before, I just can't find the relevant post now)? May be a bug either in
Cayenne or in the JDBC driver....
> one question:
> maxlength, does this mean 4 digits?
"4" is the length of the column in bytes as reported by the database. This
is not the number of decimal digits.
> and if so, how is this enforced?
> cause I have entries with id's > 9999 ?
> for example in the auto_pk_support table for reportingdates the next id is
> 10100
It is not enforced by Cayenne. The only place where this is used now is in
forward engineering - generating the tabels from the DataMap.
Andrus
This archive was generated by hypermail 2.0.0 : Fri Dec 13 2002 - 10:17:29 EST