You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cayenne.apache.org by "Andrus Adamchik (JIRA)" <ji...@apache.org> on 2016/11/29 15:58:58 UTC
[jira] [Created] (CAY-2157) Smart AUTO_PK_SUPPORT generation
Andrus Adamchik created CAY-2157:
------------------------------------
Summary: Smart AUTO_PK_SUPPORT generation
Key: CAY-2157
URL: https://issues.apache.org/jira/browse/CAY-2157
Project: Cayenne
Issue Type: Bug
Environment: Derby, Unit test environment
Reporter: Andrus Adamchik
Priority: Minor
I am using bootique-cayenne-test to setup integration tests in my app. Models come from 2 DataMaps, and Bootique runs DbGenerator for each map. On the second path I am getting the exception below. Luckily it is caught and ignored, still the test log looks bad.
There are two issues here:
* DbGenerator (or whatever adapter-generated code it executes) doesn't check for the table presence. It should do that , and only create this table if it is absent.
* In my case it should not generate AUTO_PK_SUPPORT to begin with, as all the entities in the DataMap have auto-incremented PK.
{noformat}
INFO [2016-11-29 15:44:08,645] main o.a.c.l.CommonsJdbcEventLogger: *** error.
org.apache.derby.iapi.error.StandardException: Table/View 'AUTO_PK_SUPPORT' already exists in Schema 'APP'.
at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.duplicateDescriptorException(Unknown Source)
at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.addDescriptor(Unknown Source)
at org.apache.derby.impl.sql.execute.CreateTableConstantAction.executeConstantAction(Unknown Source)
at org.apache.derby.impl.sql.execute.MiscResultSet.open(Unknown Source)
at org.apache.derby.impl.sql.GenericPreparedStatement.executeStmt(Unknown Source)
at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown Source)
{noformat}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)