Hi there,
I try to realize a many-to-many-relationship in my bean. The database is as follows:
Code:
Users {
USR_ID
...
}
Usergroups {
USRGRP_ID
USRGRP_NAME
}
Users_Usergroups {
USR_ID
USRGRP_ID
}
I just want to access a collection of users from a usergroup. So I tried this:
Code:
@ManyToMany
@JoinTable(
name="USERS_USERGROUPS",
joinColumns=@JoinColumn(name="USRGRP_ID"),
inverseJoinColumns=@JoinColumn(name="USR_ID")
)
@IndexColumn(name="USRGRP_ID")
public User[] getUsers() {
return users;
}
Since there is a limitation in the JSF library I use, I can't use a java.util.Set for "users". It has to be an array or a java.util.List. So I had to introduce this @IndexColumn annotation, but I don't know what this annotation is good for.
Has anybody a hint?
Thanks you very much in advance
Newlukai