cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "nico (JIRA)" <>
Subject [jira] [Updated] (CAY-1576) PK Generation with "meaningful PK"
Date Wed, 01 Jun 2011 14:50:47 GMT


nico updated CAY-1576:

I found something.
I think it can be done with 
DataContext context = DataContext.createDataContext();

because it is not supported by default.
But I think it would be nice, if I can configure it in Cayenne Modeler.

> PK Generation with "meaningful PK"
> ----------------------------------
>                 Key: CAY-1576
>                 URL:
>             Project: Cayenne
>          Issue Type: Question
>          Components: Database integration
>    Affects Versions: 3.1M1
>         Environment: Win7 with PostgreSQL 9
>            Reporter: nico
>              Labels: features
> I have a question about the primary generation.
> I generate all classes with the Cayenne Modeler from the database with "meaningful PK"
option, because I need the getId()-method from the entity, which gives me the Pk from the
> I set the Pk Generation Stategy to Database-Generated in all DbEntities, because I don't
wan't to set the Pk by myself or by Cayenne, but by database.
> Now I have the situation that Cayenne fetch the first PK from DB by calling the sequence
in Db, then Cayenne increment the ID 20 times (on 20 inserts) and send the IDs (PKs) to database,
then cayenne call another time the sequence for next Pk id and so on.
> But I don't want that cayenne send any generated PK Id to database and only let the database
generate the Ids. I think this is a result of the "meaningful PK" setting.
> Is there any solution to get the database PK Id from a Object Entity (at best with getId()-method)
without a database call and let the database generate the primary keys?
> I hope this is understandable.
> thanks in advance

This message is automatically generated by JIRA.
For more information on JIRA, see:

View raw message