Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] Column specified twice in insert statement

For the records, the first problem (column specified twice) was caused by the fact that in my case SecondaryEntity had an embeddable field which erroneously extended the same mapped superclass, hence EclipseLink was trying to put the mapped superclass attributes more than once in the SQL insert statement.

Unfortunately, no error or warning was produced by EclipseLink at any stage in the modelling phase, at startup time or when I generated tables from entities. I opened bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=456054 for this.

Mauro

Il 23/12/2014 00:28, Mauro Molinari ha scritto:
Hi,
I have the following problem. I have a mapped superclass:

What I'm seing is that when I try to persist an instance of SecondaryEntity, EclipseLink generates a SQL statement that repeats the fields of the mapped superclass: INSERT INTO SecondaryEntity ('field1', 'field2', 'version', 'foo', 'bar', 'field3', 'version', 'foo', 'bar', 'main_id') VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)

Of course, MySql complains: Column 'version' specified twice (I think it doesn't mention 'foo' and 'bar' because it stops at 'version', but they are repeated, too).

Am I doing something wrong? Is there a problem in EclipseLink with the combination "shared primary key" and "mapped superclass"?


Back to the top