cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrus Adamchik <>
Subject Re: CayenneRuntimeException - temporary ID not replaced
Date Tue, 02 Aug 2011 12:59:34 GMT
See Wernke's reply in the previous thread. You can have a meaningful primary key. Just manually
map an ObjAttribute for it and set it in the code. You still *must* have a designated DbEntity
column marked as PK whether it is meaningful or not.


On Aug 2, 2011, at 12:29 PM, amulya rattan wrote:

> All,
> I am getting the following exception.
> Exception in thread "main" org.apache.cayenne.CayenneRuntimeException:
> [v.3.0RC2 Feb 03 2010 13:38:54] Temporary ID hasn't been replaced on commit:
> {<ObjectId:Meters, TEMP:000000CDED480001>; new; [modelId=>123;
> meterId=>1234567]}
> Looks like the temp id mentioned in the exception had to be replaced by some
> primary key value? But I should mention that I didn't keep any primary key
> in my table since when i do, Cayenne doesn't create a setter/getter for it,
> but I want to be able to set the primary key myself instead of Cayenne or
> database generated. I am guessing there must be a way around it. Any
> pointers are appreciated.
> ~Amulya

View raw message