openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From realdepp <thepsy...@freenet.de>
Subject Duplicate column on repeated schema generation
Date Thu, 14 Apr 2011 15:55:12 GMT
Hi,

I got an @Embedded object with an @ElementCollection (Map) inside.

And in persistence.xml, the following property is set:


When I start my application for the second time (without clearing the
database) I get the following exception:
 org.apache.openjpa.persistence.PersistenceException: Doppelter Spaltenname
vorhanden: 'EMBEDDEDOBJECT__OWNINGOBJECTID' {stmnt 3819554 ALTER TABLE
`EmbeddedObject__mapName` ADD `EMBEDDEDOBJECT__OWNINGOBJECTID` BIGINT}
[code=1060, state=42S21]
at org.apache.openjpa.jdbc.meta.MappingTool.record(MappingTool.java:558)
at org.apache.openjpa.jdbc.meta.MappingTool.record(MappingTool.java:456)
at
org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory.synchronizeMappings(JDBCBrokerFactory.java:160)
at
org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory.synchronizeMappings(JDBCBrokerFactory.java:164)
at
org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory.newBrokerImpl(JDBCBrokerFactory.java:122)
at
org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:210)
at
org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(DelegatingBrokerFactory.java:156)
at
org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:227)
at
org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:154)
at
org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:60)
at x.y.z.jpa.JPAManager.initJPA(JPAManager.java:450)
at x.y.z.DataDefManagerJUnit.setUp(DataDefManagerJUnit.java:84)
at junit.framework.TestCase.runBare(TestCase.java:125)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at
org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:518)
at
org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.launch(JUnitTestRunner.java:1052)
at
org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:906)
Caused by: org.apache.openjpa.lib.jdbc.ReportingSQLException: Doppelter
Spaltenname vorhanden: 'EMBEDDEDOBJECT__OWNINGOBJECTID' {stmnt 3819554 ALTER
TABLE `EmbeddedObject__mapName` ADD `EMBEDDEDOBJECT__OWNINGOBJECTID` BIGINT}
[code=1060, state=42S21]
at
org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.wrap(LoggingConnectionDecorator.java:281)
at
org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.wrap(LoggingConnectionDecorator.java:265)
at
org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.access$700(LoggingConnectionDecorator.java:72)
at
org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator$LoggingConnection$LoggingStatement.executeUpdate(LoggingConnectionDecorator.java:975)
at
org.apache.openjpa.lib.jdbc.DelegatingStatement.executeUpdate(DelegatingStatement.java:136)
at
org.apache.openjpa.jdbc.schema.SchemaTool.executeSQL(SchemaTool.java:1221)
at org.apache.openjpa.jdbc.schema.SchemaTool.addColumn(SchemaTool.java:1054)
at org.apache.openjpa.jdbc.schema.SchemaTool.add(SchemaTool.java:503)
at org.apache.openjpa.jdbc.schema.SchemaTool.add(SchemaTool.java:363)
at org.apache.openjpa.jdbc.schema.SchemaTool.run(SchemaTool.java:340)
at org.apache.openjpa.jdbc.meta.MappingTool.record(MappingTool.java:505)
... 21 more

Is there a way to workaround that? Is that considered a bug?
It's a bit annoying...


--
View this message in context: http://openjpa.208410.n2.nabble.com/Duplicate-column-on-repeated-schema-generation-tp6273346p6273346.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.

Mime
View raw message