[jboss-user] [EJB 3.0] - Re: MappingException: Repeated column in mapping for entity
do-not-reply at jboss.com
Mon Mar 24 15:45:51 EDT 2008
I had to hack to Hibernate core to make this work. I changed the line that throws the exception to just issue a warning and I can now read rows successfully. The proper class is returned based on the discriminator column value as expected.
This must be a bug as I definitely do no have duplicated column names. My class has a lot of transients. Maybe that is somehow tripping up the validation of the class.
However: when I try to insert a row using EJB3 I get an error. I have not fully researched this but it looks like Hibernate is adding an additional column to the insert statement it generates.
I get : Caused by: java.sql.SQLException: Parameter index out of range (14 > number of parameters, which is 13)
My table has 14 columns + primary key = 15 total. I dont think the Hibernate insert uses the primary key column. Guessing about that then it should insert 13 columns but appears to be adding another with some large integer value.
I am about to reembark on solving this problem.
Of note: someone in the Hibernate forum suggested removing the discriminator column. Seemed strange to me. How would one know what class to build when retrieving the column? Tried it anyway. Did not work.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4138580#4138580
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4138580
More information about the jboss-user