Java利用hibernate进行一对多查询时,把另一张表作为一个属性存进这张表的字段中,返回的类型是set类型,要对返回的set类型进行排序 user表 package onlyfun.caterpillar; public class User { private Long id; private String name; public User() {} public Long getId() { return id; } public void setId(Long id) { this
代码如下: 实体类: public class User implements Serializable { private static final long serialVersionUID = 1L; private String pkid; private String userName; private String passWord; private String roleID; } 遍历: public class test { public static void main(St