cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ari Maniatis (JIRA)" <j...@apache.org>
Subject [jira] Updated: (CAY-527) Improvement of MySql PK Generator
Date Wed, 06 Jan 2010 11:54:55 GMT

     [ https://issues.apache.org/jira/browse/CAY-527?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Ari Maniatis updated CAY-527:
-----------------------------

    Component/s:     (was: Core Library)
                 Database integration

> Improvement of MySql PK Generator
> ---------------------------------
>
>                 Key: CAY-527
>                 URL: https://issues.apache.org/jira/browse/CAY-527
>             Project: Cayenne
>          Issue Type: Improvement
>          Components: Database integration
>    Affects Versions: 1.2 branch
>         Environment: WinXP, Java 5
>            Reporter: Borut Bolcina
>             Fix For: Undefined future
>
>
> Hi,
> I am constructing database tables with dbGenerator like this
>    DbGenerator generator = new DbGenerator(autoDbAdapter, dataMap);
>    generator.setShouldCreatePKSupport(true);
>    generator.setShouldCreateFKConstraints(true);
>    generator.setShouldDropTables(false);
>    generator.runGenerator(dataSource);
> This code executes every time an application is restarted. Becouse setShouldDropTables
is set to false, the tables in that database are created only the first time - as it should
be. But, becouse setShouldCreatePKSupport is set to true, this gets executec every time
> INFO  QueryLogger: DELETE FROM AUTO_PK_SUPPORT WHERE TABLE_NAME IN ('source')
> INFO  QueryLogger: INSERT INTO AUTO_PK_SUPPORT (TABLE_NAME, NEXT_ID) VALUES ('source',
200)
> Of course I don't want AUTO_PK_SUPPORT to delete and reset values already there from
previous application runs. Is there a way, when this
>    INFO  QueryLogger: *** error.
>    java.sql.SQLException: Table 'AUTO_PK_SUPPORT' already exists
> happens, that the above DELETE and INSERT don't happen? 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message