如何创建一个具有引用同一类的列表的对象

时间:2013-03-13 16:51:44

标签: jpa jpa-2.0

由于JPA映射,我有3个以上的类,UserRole类。我如何填充我的User类,它作为我的JSF页面的支持bean?

User.Java

    public class User implements Serializable {
private String name;
private List<UserRole> userRoleList;
//getters and setters for both

Role.Java

    public class Role implements Serializable {
private String roleName;
//getters and setters

UserRole.Java

    public class UserRole implements Serializable {
private Role role;
private User user;
//getters and setters for both

提前致谢

0 个答案:

没有答案