cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Faust <arjfa...@gmail.com>
Subject Re: creating DB tables, even for existing schema
Date Fri, 17 Feb 2012 14:53:12 GMT
I don't remember how to turn-off auto-key generation; but it's probably how
the mapping file defines your key value in any given table.  Nevertheless,
assuming auto-key generation is left on, then you need a table in your db
as follows:

CREATE TABLE AUTO_PK_SUPPORT (TABLE_NAME CHAR(100) NOT NULL, NEXT_ID BIGINT
NOT NULL,
    PRIMARY KEY(TABLE_NAME));

Then, insert a ROW with two column values: the name of the db table; and
then an initial value.

INSERT INTO AUTO_PK_SUPPORT (TABLE_NAME, NEXT_ID) VALUES ('EVENT', 1);




On Fri, Feb 17, 2012 at 4:15 AM, ngong <mailinglist@august.de> wrote:

> Dear Cayenne Confidant,
>
> In Cayenne wiki I found the sentence:
> "Even if you work with an existing database schema, special database
> objects
> may need to be created to support automated primary key generation."
>
> This could be related to my problem. Is there any further link providing
> more detailed explanation what special objects I got to create in a
> database
> that I am accessing by reengineering?
>
> Another solution would be: how to swtich off any key generation support?
>
> Kind Regards
>
>
> Rolf
>
> --
> View this message in context:
> http://cayenne.195.n3.nabble.com/creating-DB-tables-even-for-existing-schema-tp3753120p3753120.html
> Sent from the Cayenne - User mailing list archive at Nabble.com.
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message