-->
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.  [ 2 posts ] 
Author Message
 Post subject: many to many with maps
PostPosted: Sat Dec 13, 2003 5:49 am 
Newbie

Joined: Thu Dec 11, 2003 1:51 pm
Posts: 4
Hi,

my classes:

public class User
{
public Integer getId()
{
return(_id);
}

public void setId()
{
_id=id;
}


public Map getGroups()
{
return(_groups);
}

public void setGroups(Map groups)
{
_groups=groups;
}

protected Integer _id;
protected Map _groups;
}



public class Group
{
public Integer getId()
{
return(_id);
}

public void setId()
{
_id=id;
}


public Map getUsers()
{
return(_users);
}

public void setUsers(Map users)
{
_users=users;
}

protected Integer _id;
protected Map _users;
}




my tables:

CREATE TABLE users
(
int id PRIMARY KEY
);

CREATE TABLE groups
(
int id PRIMARY KEY
);

CREATE TABLE group_memberships
(
user_id int REFERENCES users(id),
group_id int REFERENCES groups(id)
);



My goal is that the keys on User.groups were the group.id and
Group.users were the user.id

I've tried many differents mappings after reading the docs... but no way.

Can somebody help me on this mapping??

Thanks in advance.
Congratulations for the great software you make!


Bernardo Antonio Buffa Colome
kreimer@bbs.frc.utn.edu.ar


Top
 Profile  
 
 Post subject:
PostPosted: Sat Dec 13, 2003 6:36 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
http://forum.hibernate.org/viewtopic.php?t=926252

_________________
Emmanuel


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

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.