新的User类

新的User类,加上了locked属性及权限相关属性

  1. package net.wendal.nutzbook.bean;
  2. import java.util.List;
  3. import org.nutz.dao.entity.annotation.ColDefine;
  4. import org.nutz.dao.entity.annotation.Column;
  5. import org.nutz.dao.entity.annotation.Id;
  6. import org.nutz.dao.entity.annotation.ManyMany;
  7. import org.nutz.dao.entity.annotation.Name;
  8. import org.nutz.dao.entity.annotation.One;
  9. import org.nutz.dao.entity.annotation.Table;
  10. @Table("t_user")
  11. public class User extends BasePojo {
  12. @Id
  13. protected int id;
  14. @Name
  15. @Column
  16. protected String name;
  17. @Column("passwd")
  18. @ColDefine(width=128)
  19. protected String password;
  20. @Column
  21. protected String salt;
  22. @Column
  23. private boolean locked;
  24. @ManyMany(from="u_id", relation="t_user_role", target=Role.class, to="role_id")
  25. protected List<Role> roles;
  26. @ManyMany(from="u_id", relation="t_user_permission", target=Permission.class, to="permission_id")
  27. protected List<Permission> permissions;
  28. @One(target=UserProfile.class, field="id", key="userId")
  29. protected UserProfile profile;
  30. }