This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes AnnotationException: : wrong number of column Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "AnnotationException: : wrong number of column" Watch "AnnotationException: : wrong number of column" New topic
Author

AnnotationException: : wrong number of column

Frank VanOor
Ranch Hand

Joined: Jun 18, 2004
Posts: 49
Hi,

the following exception happens during hibernate initialisation:

Initial SessionFactory creation failed.org.hibernate.AnnotationException: A Foreign key refering com.stockdomain.domain.Future from com.stockdomain.domain.BrokerRealTimeFuture has the wrong number of column. should be 2


What could the reason that hibernate says that the number of columns should be 2 ? The Primary key in table "Future" is id, so only one column.







Part of pom.xml :

Frank VanOor
Ranch Hand

Joined: Jun 18, 2004
Posts: 49
Found the reeason. The class BaseEntity also has a column id, so there was a duplcation.
 
jQuery in Action, 2nd edition
 
subject: AnnotationException: : wrong number of column
 
Similar Threads
Outer join between 3 entities in HQL
using 2 @OnetoMany annoations in one Entity Class
Why is my Hibernate Search query not working?
@OneToMany primary key part of foreign key
Edit primary key, if it's a foreign key