No, it is not that case... :( I think it is a little more complicated.
I want to store a collection of users and a collection of groups, that has users inside. I don't have a list of users containing users, and I'dont have nested groups.
I have the class User, that represents one User. The collection off users is the class Users, that has an object Hashtable that contains objects of User type.
public class User {
String name;
...
}
public class Users {
Hashtable users; // Collection of User
int c;
...
}
I have a class Group, that represents one Group and contains a collection of Users. The collection off groups is the class Groups, that has an object Hashtable that contains objects of Group type.
public class Group {
Users users;
String mail;
...
}
public class Groups {
Hashtable group; // Collection of Group
int c;
...
}
What I want to know is if I store the class Groups I'm storing all the users too... and how is the mapping between tables Groups and the class Groups, that only has a hashtable.
How I tell hibernate that when I want to store the class Groups it has to store all the objects of Group type, and all the users they have.
I hope I make it easier to understand... =)
Luciana
|