81,094
社区成员
发帖
与我相关
我的任务
分享
public class User {
private Integer userid; //编号
private String username; //用户名
private String sex; //性别
private String password; //密码
private String realname; //真实姓名
private String phone; //手机号
private String picture; //头像
private String idnum; //身份证号
private Integer permission; //权限(普通用户权限均为1,2号权限只对专家用户开发,且无法个人申请)
//用户发布出售商品的集合
private Set<SaleProduct> saleProducts=new HashSet<SaleProduct>();
public class SaleProduct {
private Integer saleid; // 编号
private String pname; // 产品的名称
private String username; // 联系人的姓名
private String phone; // 联系人的手机号
private Double price; // 价格
private Integer num; // 库存
private String picture; // 相关图片
private String state;
private Date publishtime;
private User user;
<set name="saleProducts" table="saleproduct">
<key column="userid"></key>
<one-to-many class="com.smartcountry.domain.SaleProduct"/>
</set>
<many-to-one name="user" column="userid"/>