-->
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: many to many mapping
PostPosted: Wed Aug 26, 2009 4:43 am 
Newbie

Joined: Tue Nov 15, 2005 7:20 am
Posts: 17
i'm a first time join user (hibernate annotation)
I've a simple problem
with only 2 tables :
Quote:
users:
user varchar(50) primekey not null

and
roles:
id auto generate
userGroup varchar(50) not null
role ...

clearly all roles can be matched to all users the classic.
Quote:
@ManyToMany(targetEntity=roles.class)//owning side many to many
@JoinTable(name="roles", catalog = "identification",schema="", //Join table specs if missing authentication_authorisation
joinColumns=@JoinColumn (name="user"), //owning side USERof the assotiation
inverseJoinColumns= @JoinColumn(name="userGroup")) //not owning ROLES side foreign key of the assotiation

individualy the tables work but as I join: them I run into trouble not understanding why
I get the following error
Quote:
exception :::
:roles [userGroup])) must have same number of columns as the referenced primary key (roles [user,userGroup])



i did erase all grouped key's all foreign keys .....
have the exact same specification fro the columns user and UserGroup
there is to me NOTHING that can be of a different number of colomns unless the whole hibernate setup is corrupt and not working
DO I INTERPRETE THE ANNOTATION BADLY ??? please give me a KICK

Ps as I use the same name in both tables , it mentions it double refferences ????

_________________
XML way to go


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.