Hi Amulya,

Firstly, instead of using 3.0 RC2, you should probably go ahead and use 3.0.2.

Next, since you say you want to set the primary key yourself (and in
another e-mail thread you mentioned the same, I believe), you will
need to add the primary key back into your ObjEntity in Cayenne
Modeler and then re-generate your class(es).  Cayenne by default
excludes PKs and FKs from the ObjEntity, but will honor you adding
them yourself.  Once you do that, you will have a setter and getter
for the primary key.

mrg


On Tue, Aug 2, 2011 at 5:29 AM, amulya rattan <[email protected]> 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
>

Reply via email to