UserList POJO如下public class UserList implements java.io.Serializable {
private static final long serialVersionUID = 8246703686105352655L;
private Integer userId;
...............
private String memoInfo;
private Set<RoleList> rolelist=new HashSet<RoleList>();
//get set方法肯定是有的
RoleList POJO如下public class RoleList implements java.io.Serializable {
private static final long serialVersionUID = -1507454205769569163L;
private Integer roleId;
private Set<UserList> userlist=new HashSet<UserList>();
//get set方法肯定是有的UserList hbm.xml文件如下<hibernate-mapping>
<class name="com.xxx.UserList" table="UserList" schema="dbo" dynamic-insert="true" lazy="false" dynamic-update="true">
<id name="userId" type="java.lang.Integer">
<column name="UserID" />
<generator class="native" />
</id>
<set name="rolelist" cascade="save-update" inverse="true" lazy="false" table="UserList_RoleList">
<key column="UserID" foreign-key="FK_UserList_RoleList_UserList"></key>
<many-to-many class="com.xxxx.RoleList" column="RoleID"></many-to-many>
</set>
</class>
</hibernate-mapping>RoleList hbm.xml文件如下
[code=java]
<hibernate-mapping>
<class name="com.xxx.RoleList" table="RoleList" dynamic-insert="true" lazy="false" dynamic-update="true" schema="dbo">
<id name="roleId" type="java.lang.Integer">
<column name="RoleID" />
<generator class="native" />
</id>
<set name="userlist" cascade="save-update" inverse="false" lazy="false" table="UserList_RoleList">
<key column="RoleID" foreign-key="FK_UserList_RoleList_RoleList"></key>
<many-to-many class="com.xxx.UserList" column="UserID"></many-to-many>
</set>
</class>
</hibernate-mapping>
求好心人帮我看看我的这个配置
private static final long serialVersionUID = 8246703686105352655L;
private Integer userId;
...............
private String memoInfo;
private Set<RoleList> rolelist=new HashSet<RoleList>();
//get set方法肯定是有的
RoleList POJO如下public class RoleList implements java.io.Serializable {
private static final long serialVersionUID = -1507454205769569163L;
private Integer roleId;
private Set<UserList> userlist=new HashSet<UserList>();
//get set方法肯定是有的UserList hbm.xml文件如下<hibernate-mapping>
<class name="com.xxx.UserList" table="UserList" schema="dbo" dynamic-insert="true" lazy="false" dynamic-update="true">
<id name="userId" type="java.lang.Integer">
<column name="UserID" />
<generator class="native" />
</id>
<set name="rolelist" cascade="save-update" inverse="true" lazy="false" table="UserList_RoleList">
<key column="UserID" foreign-key="FK_UserList_RoleList_UserList"></key>
<many-to-many class="com.xxxx.RoleList" column="RoleID"></many-to-many>
</set>
</class>
</hibernate-mapping>RoleList hbm.xml文件如下
[code=java]
<hibernate-mapping>
<class name="com.xxx.RoleList" table="RoleList" dynamic-insert="true" lazy="false" dynamic-update="true" schema="dbo">
<id name="roleId" type="java.lang.Integer">
<column name="RoleID" />
<generator class="native" />
</id>
<set name="userlist" cascade="save-update" inverse="false" lazy="false" table="UserList_RoleList">
<key column="RoleID" foreign-key="FK_UserList_RoleList_RoleList"></key>
<many-to-many class="com.xxx.UserList" column="UserID"></many-to-many>
</set>
</class>
</hibernate-mapping>
求好心人帮我看看我的这个配置
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货