Advertisement
Guest User

Untitled

a guest
May 23rd, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.56 KB | None | 0 0
  1. /*
  2. * To change this license header, choose License Headers in Project Properties.
  3. * To change this template file, choose Tools | Templates
  4. * and open the template in the editor.
  5. */
  6. package entity;
  7.  
  8. import java.io.Serializable;
  9. import javax.persistence.Column;
  10. import javax.persistence.Entity;
  11. import javax.persistence.GeneratedValue;
  12. import javax.persistence.GenerationType;
  13. import javax.persistence.Id;
  14.  
  15. /**
  16. *
  17. * @author Vlad Petcu
  18. */
  19. @Entity
  20. public class Chart implements Serializable {
  21.  
  22. private static final long serialVersionUID = 1L;
  23. @Id
  24. @GeneratedValue(strategy = GenerationType.AUTO)
  25. private Long id;
  26. @Column(name = "CHART_ID")
  27. private Long chartID;
  28. @Column (name = "ARTIST_ID")
  29. private Long artistID;
  30. @Column (name = "ALBUM_ID")
  31. private Long albumID;
  32. @Column (name = "POSITION")
  33. private Long position;
  34.  
  35. public Chart(Long chartID, Long artistID, Long albumID, Long position)
  36. {
  37. this.chartID = chartID;
  38. this.artistID = artistID;
  39. this.albumID = albumID;
  40. this.position = position;
  41. }
  42.  
  43. public Chart()
  44. {
  45.  
  46. }
  47.  
  48. public Long getChartID() {
  49. return chartID;
  50. }
  51.  
  52. public void setChartID(Long chartID) {
  53. this.chartID = chartID;
  54. }
  55.  
  56. public void setArtistID(Long artistID) {
  57. this.artistID = artistID;
  58. }
  59.  
  60. public void setAlbumID(Long albumID) {
  61. this.albumID = albumID;
  62. }
  63.  
  64. public void setPosition(Long position) {
  65. this.position = position;
  66. }
  67.  
  68. public Long getArtistID() {
  69. return artistID;
  70. }
  71.  
  72. public Long getAlbumID() {
  73. return albumID;
  74. }
  75.  
  76. public Long getPosition() {
  77. return position;
  78. }
  79.  
  80. public Long getId() {
  81. return id;
  82. }
  83.  
  84. public void setId(Long id) {
  85. this.id = id;
  86. }
  87.  
  88. @Override
  89. public int hashCode() {
  90. int hash = 0;
  91. hash += (id != null ? id.hashCode() : 0);
  92. return hash;
  93. }
  94.  
  95. @Override
  96. public boolean equals(Object object) {
  97. // TODO: Warning - this method won't work in the case the id fields are not set
  98. if (!(object instanceof Chart)) {
  99. return false;
  100. }
  101. Chart other = (Chart) object;
  102. if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
  103. return false;
  104. }
  105. return true;
  106. }
  107.  
  108. @Override
  109. public String toString() {
  110. return "entity.Chart[ id=" + id + " ]";
  111. }
  112.  
  113. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement