cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Denis Koyro (JIRA)" <j...@apache.org>
Subject [jira] [Created] (CAY-2016) cdbimport: Rename table with toMany relationship causes migration error
Date Thu, 04 Jun 2015 09:00:48 GMT
Denis Koyro created CAY-2016:
--------------------------------

             Summary: cdbimport: Rename table with toMany relationship causes migration error

                 Key: CAY-2016
                 URL: https://issues.apache.org/jira/browse/CAY-2016
             Project: Cayenne
          Issue Type: Bug
    Affects Versions: 4.0.M3
            Reporter: Denis Koyro


Tested on Cayenne 4.0.M3.3f0c7f9
Let's consider the example with "artist" and "painting" tables.
"artist" table was renamed as "artist2"
Here are cdbimport logs:

[INFO] Detected changes: 
[INFO]     Add Relationship     artist2 painting->artist2.id
[INFO]     Create Table         artist2
[INFO]     Drop db-relationship  artist painting->artist.id
[INFO]     Drop db-relationship  paintings artist->painting.artist_id
[INFO]     Drop Table           artist

[ERROR] Migration Error. Can't apply changes from token: Add Relationship (artist2 painting->artist2.id)
java.lang.IllegalArgumentException: An attempt to override relationship 'artist2'
	at org.apache.cayenne.map.Entity.addRelationship(Entity.java:193)
	at org.apache.cayenne.merge.AddRelationshipToModel.execute(AddRelationshipToModel.java:43)
	at org.apache.cayenne.tools.dbimport.DbImportAction.execute(DbImportAction.java:218)
	at org.apache.cayenne.tools.dbimport.DbImportAction.execute(DbImportAction.java:118)
	at org.apache.cayenne.tools.DbImporterMojo.execute(DbImporterMojo.java:256)
	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
	at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
	at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
	at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
	at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
	at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
	at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
	at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message