Cmsuserentry
set<cmsroleentry> Roles =new cmsroleentry ();
Public void Get Roles (){
Return Roles ;
}
Public void Set Roles (set<cmsroleentry> cmsroleentrys) {
Thisnansroleentrys=cmsroleentrys;
}
Cmsroleentry
set<cmsuserentry> Users =new cmsuserentry ();
Public void Get Users (){
Return Users ;
}
Public void Set Users (set<cmsuserentry> cmsuserentrys) {
This . Users =cmsuserentrys;
}
Cms_role_config Intermediate Table
Users is a property of the set type in the current class
Jc_user_role This is the middle table .
role_id This is the middle table. role_id
user_id This is the middle table. user_id
Cmsuser Entry This is associated with the other party class
set name "users" &NBSP; table "Jc_user_role"
< Key column="role_id"/>
<Many-to-many column="user_id" class="CmsuserEntry"/>
</ Set >
Cms_user_config
set name "roles" table "Jc_user_role"
< Key column="user_id"/>
<Many-to-many column="role_id" class="Cmsrole"/>
</ Set >
If you have one or two more, you have an intermediate table.
Just use
recommends This is the property of the set type in the current class;
hj_user_recommendation This is the middle table .
This is the current and intermediate table id Association (not many-to-many default is current id associated field with intermediate table id corresponds)
The class to be associated with
set name "recommends" table "hj_user_recommendation" >
key column "user_id"
< One-to-many class="cn.bizws.ismpNaNs.entity.main.UserRecommend"/>
</ Set >
Hibernate many-to-many association configuration file notation