cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Scott Anderson" <>
Subject RE: Specifying PK when creating a new object in DB generated PK mode
Date Wed, 20 Feb 2008 18:31:01 GMT
It looks like there's no model that fits what I'd like to do. IMO, the
user should be able to specify the PK in DB-generated mode when either
the field is exposed, or the PK is set through the ObjectID map. Cayenne
should not disregard user-made decisions: it isn't Cayenne's
responsibility to enforce PK integrity.

-----Original Message-----
From: Aristedes Maniatis [] 
Sent: Wednesday, February 20, 2008 2:01 AM
Subject: Re: Specifying PK when creating a new object in DB generated PK

On 20/02/2008, at 9:51 AM, Scott Anderson wrote:

> I am working an a request ticket system, similar to the one I'm using 
> to enter this issue. I need to import requests from the old schema to 
> the new schema, and the PKs must be specified while doing an import. 
> When using the tool normally, the PKs must be database generated. Is 
> there any way to do this?

You can specify the key yourself easily:

But I can't see how you can guarantee you will not get collisions
between your two schemes. Maybe better to keep the old key in a separate
field for reference purposes.

Ari Maniatis

View raw message