Bonjour,
Je cherche la syntaxe correcte en fichier hbm pour mapper Map < Application , Set<Role>>.
L'idée est que chaque utilisateur peut avoir de 0 à n role suivant dans différentes applications.
en Java
private Map<Application, SortedSet<ApplicationRight>> applicationAllowed;
l'hbm testé
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
|
<class name="model.users.User" table="USERS">
<id name="id" type="long" column="USERS_ID" unsaved-value="0">
<generator class="native" />
</id>
<property name="utcode" type="string" column="UTCODE" length="6"/>
<property name="password" type="string" column="PASSWORD" length="40"/>
<property name="firstName" type="string" column="FIRST_NAME" length="20"/>
<property name="lastName" type="string" column="LAST_NAME" length="20"/>
<property name="email" type="string" column="EMAIL" length="50"/>
<map name="applicationAllowed" cascade="all,delete-orphan" lazy="true" table="USER_APPLICATIONS_RIGHTS">
<key column="USERS_ID"/>
<map-key-many-to-many column="APPLICATION_ID" class="model.users.Application"/>
<many-to-many column="APPLICATION_RIGHT_ID" class="model.users.ApplicationRight"/>
</map>
</class> |
J'ai cherché des infos via Google, mais je n'ai pas trouvé grand chose
Par avance merci
Partager