-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Problems with composite primary keys
PostPosted: Thu Dec 02, 2010 5:26 am 
Newbie

Joined: Tue Nov 09, 2010 7:31 am
Posts: 4
Hi all !

I have a composite primary key composed by one foreing key from one schema and another foreign key from another different schema, and also another field that is not a foreign key, here is the code.

Code:
@Table(name = "TABLE_A", schema="SCHEM_A") 
public class Ejercicio implements java.io.Serializable { 
 
 
private TableAId id; 
 
 
 
 
 
@SuppressWarnings("serial") 
@Embeddable 
public class TableAId implements java.io.Serializable { 
 
@Column(name = "ID_TABLE_A", nullable=false) 
private Integer idTableA; 
 
@JoinColumn(name = "ID_COLUM_B") 
@ManyToOne 
private ColumnB idColumB; 
 
@JoinColumn(table="SCHEMA_B.TABLE_B", name = "ID_TABLE_B") 
@ManyToOne 
private TABLE_B idTableB; 


When we try to execute this HQL query, "select A from TABLE_A A" this exception is thrown:
Code:
com.ibm.db2.jcc.a.SqlException: DB2 SQL error: SQLCODE: -206, SQLSTATE: 42703, SQLERRMC: TABLE_A0_.IDTABLE_A   


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.