S
Snyke
Once again I'm running against a solid wall of errors, and my head
starts to hurt really badly with this one
I have a bidirectional link between two classes
Account <=> User
this being a many-to-many relationship. Until now nothing fancy, but I
have a Class inbetween that manages accessrights called Privilge, this
just has two boolean values (read and write) that tell wether a user
can read or write to the account.
Account <-many-to-one-> Privilege <-one-to-many-> User
basically every Account-User combination has a Privilege. Now the idea
was to have first the mapping of the Privilege Class like this:
<class name="net.snyke.tmm.Privilege" table="privilege">
<id name="id" column="id">
<generator class="native"/>
</id>
<property name="read" column="isRead"/>
<property name="write" column="isWrite"/>
</class>
and then let the other classes reference each other over this table:
<set name="accountPrivileges" table="privilege">
<key column="user"/>
<many-to-many column="account" class="net.snyke.tmm.Account"/>
</set>
What I'm trying to say is, why add another two tables to manage the
relationships between Privilege-User and Privilege-Account, when I can
just use the existing table Privilege? Or did I get something wrong?
Regards,
Christian 'Snyke' Decker
http://www.Snyke.net
starts to hurt really badly with this one
I have a bidirectional link between two classes
Account <=> User
this being a many-to-many relationship. Until now nothing fancy, but I
have a Class inbetween that manages accessrights called Privilge, this
just has two boolean values (read and write) that tell wether a user
can read or write to the account.
Account <-many-to-one-> Privilege <-one-to-many-> User
basically every Account-User combination has a Privilege. Now the idea
was to have first the mapping of the Privilege Class like this:
<class name="net.snyke.tmm.Privilege" table="privilege">
<id name="id" column="id">
<generator class="native"/>
</id>
<property name="read" column="isRead"/>
<property name="write" column="isWrite"/>
</class>
and then let the other classes reference each other over this table:
<set name="accountPrivileges" table="privilege">
<key column="user"/>
<many-to-many column="account" class="net.snyke.tmm.Account"/>
</set>
What I'm trying to say is, why add another two tables to manage the
relationships between Privilege-User and Privilege-Account, when I can
just use the existing table Privilege? Or did I get something wrong?
Regards,
Christian 'Snyke' Decker
http://www.Snyke.net