aspose file tools*
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
Author

Problem with onetomany relantionship with JPA 2.0

Diego Armando Zarate Diaz
Greenhorn

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(Util.java:406) at com.mysql.jdbc.Util.getInstance(Util.java:381) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1015) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3558) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3490) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1959) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2109) at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2643) at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2077) at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:2228) at org.apache.tomcat.dbcp.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:92) at org.openxava.tab.impl.JDBCTabProvider.nextBlock(JDBCTabProvider.java:235) at org.openxava.tab.impl.JDBCTabProvider.nextChunk(JDBCTabProvider.java:258) at org.openxava.tab.impl.EntityTabDataProvider.nextChunk(EntityTabDataProvider.java:35) at org.openxava.tab.impl.EntityTab.nextChunk(EntityTab.java:298) at org.openxava.tab.impl.TableModelBean.getRow(TableModelBean.java:120) at org.openxava.tab.impl.TableModelBean.getValueAt(TableModelBean.java:171) at org.openxava.tab.impl.XTableModelDecoratorBase.getValueAt(XTableModelDecoratorBase.java:63) at org.openxava.tab.impl.HiddenXTableModel.getValueAt(HiddenXTableModel.java:70) at
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17250
    
    6

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.

Thanks

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Diego Armando Zarate Diaz
Greenhorn

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.

Cheers!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem with onetomany relantionship with JPA 2.0