Guest User

Untitled

a guest
May 25th, 2016
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. public class Status implements Serializable {
  2.  
  3. private static final long serialVersionUID = -6253387194209148223L;
  4.  
  5. @Id
  6. @GeneratedValue(strategy = GenerationType.IDENTITY)
  7. @Column(unique = true, nullable = false)
  8. private Integer id;
  9.  
  10. @Column(nullable = false, length = 90)
  11. private String descr;
  12.  
  13. @Column(name = "dropdown_order", nullable = false)
  14. private Integer dropdownOrder;
  15.  
  16. public enum StatusEnum {
  17. DRAFT(1), PENDING_REVIEW(2), UNDER_REVIEW(3);
  18. private Integer status;
  19. private StatusEnum(Integer status) {
  20. this.status = status;
  21. }
  22. public Integer getStatus() {
  23. return status;
  24. }
  25.  
  26. public void setStatus(Integer status) {
  27. this.status = status;
  28. }
  29. }
  30.  
  31. Integer status = StatusEnum.DRAFT.getStatus();
  32. Status status = statusDao.findByPk(status.longValue());
Add Comment
Please, Sign In to add comment