It's not a secret anymore!
The moose likes Object Relational Mapping and the fly likes Problem with onetomany relantionship with JPA 2.0 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Problem with onetomany relantionship with JPA 2.0" Watch "Problem with onetomany relantionship with JPA 2.0" New topic

Problem with onetomany relantionship with JPA 2.0

Diego Armando Zarate Diaz

Joined: Oct 01, 2009
Posts: 4
Hello everybody, i have a problem with a onetomany relationship, i have a elementostvpaga that can have many canales and a canales class tha can have many elementostvpaga, when in mi view i tried to visualize it i get an error i put my classes and the log with the error, thks.

and the error log, cheers!

GRAVE: Fallo al ejecutar SELECT IdCanal, IdProductosTelecom, T_canales.Nombre from Paquetecanal left join Canales T_canales on Paquetecanal.IdCanal = T_canales.IdCanal WHERE Paquetecanal.IdProductosTelecom = ?

com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Column 'IdCanal' in field list is ambiguous at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) at java.lang.reflect.Constructor.newInstance(Unknown Source) at com.mysql.jdbc.Util.handleNewInstance( at com.mysql.jdbc.Util.getInstance( at com.mysql.jdbc.SQLError.createSQLException( at com.mysql.jdbc.SQLError.createSQLException( at com.mysql.jdbc.MysqlIO.checkErrorPacket( at com.mysql.jdbc.MysqlIO.checkErrorPacket( at com.mysql.jdbc.MysqlIO.sendCommand( at com.mysql.jdbc.MysqlIO.sqlQueryDirect( at com.mysql.jdbc.ConnectionImpl.execSQL( at com.mysql.jdbc.PreparedStatement.executeInternal( at com.mysql.jdbc.PreparedStatement.executeQuery( at org.apache.tomcat.dbcp.dbcp.DelegatingPreparedStatement.executeQuery( at at at at at at at at at
Mark Spritzler

Joined: Feb 05, 2001
Posts: 17276

OK, please don't duplicate post the same question. Although I like the CODE tags look here in this thread, so i am going to close the other one, but look at my last reply and reply to that here.



Perfect World Programming, LLC - iOS Apps
How to Ask Questions the Smart Way FAQ
Diego Armando Zarate Diaz

Joined: Oct 01, 2009
Posts: 4
Ok, i read your response at the another post, i post again for the information was cleareast, sorry for the inconvenients. And thks for your time.

I agree. Here's the link:
subject: Problem with onetomany relantionship with JPA 2.0
jQuery in Action, 3rd edition