-->
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: Hibernate Mapping: ForeignKey MappingException
PostPosted: Tue Nov 26, 2013 12:26 pm 
Newbie

Joined: Tue Nov 26, 2013 12:11 pm
Posts: 1
Dear Hibernate Team,

I'm getting the following Hibernate Exception, anyone knows about it?

Foreign key (FK_1h1baebylkp55202kt9spbbns:DUMMYTABLE [SIZE])) must have same number of columns as the referenced primary key (DUMMYTABLE [SIZE,idx])

This is my hibernate mapping file:

<hibernate-mapping>
<class name="DummyTable" table="DUMMYTABLE">
<id name="size" type="java.math.BigInteger">
<column name="SIZE" />
<generator class="assigned" />
</id>
<list name="values" inverse="false" table="DUMMYTABLE" lazy="true" access="field">
<key>
<column name="SIZE" />
</key>
<list-index></list-index>
<element type="javax.xml.bind.JAXBElement&lt;java.util.List&lt;java.lang.Double&gt;&gt;">
<column name="VALUES" />
</element>
</list>
<property name="xargument" type="java.lang.String">
<column name="XARGUMENT" />
</property>
<property name="yargument" type="java.lang.String">
<column name="YARGUMENT" />
</property>
</class>
</hibernate-mapping>


And this is the java class:

@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "dummyTable", propOrder = {
"size",
"values"
})
public class DummyTable {

@XmlElement(name = "Size")
protected BigInteger size;
@XmlElementRef(name = "Values", namespace = "<my-own-name-space>", type = JAXBElement.class)
protected List<JAXBElement<List<Double>>> values;
@XmlAttribute(name = "Xargument", required = true)
protected String xargument;
@XmlAttribute(name = "Yargument", required = true)
protected String yargument;

//getters and setters....
}

Thanks a lot!


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.