Advertisement
Guest User

Untitled

a guest
Jan 25th, 2020
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.08 KB | None | 0 0
  1. package com.telerikacademy.ridepal.models;
  2.  
  3. import com.fasterxml.jackson.annotation.JsonIgnore;
  4. import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
  5.  
  6. import javax.persistence.*;
  7.  
  8. @Entity
  9. @Table(name = "tracks")
  10. @JsonIgnoreProperties(ignoreUnknown = true)
  11. public class Track {
  12. @Id
  13. // @GeneratedValue(strategy = GenerationType.IDENTITY)
  14. @Column(name = "track_id")
  15. private long id;
  16. @Column(name = "title")
  17. private String title;
  18. @Column(name = "duration")
  19. private String duration;
  20. @Column(name = "rank")
  21. private String rank;
  22. @Column(name = "preview")
  23. private String preview;
  24. @Column(name = "enabled")
  25. private boolean enabled;
  26.  
  27. @ManyToOne(cascade = CascadeType.ALL)
  28. @JoinColumn(name = "artist_id")
  29. private Artist artist;
  30.  
  31. @ManyToOne(cascade = CascadeType.ALL)
  32. @JoinColumn(name = "album_id")
  33. private Album album;
  34.  
  35. public Track() {
  36. }
  37.  
  38. public long getId() {
  39. return id;
  40. }
  41.  
  42. public void setId(long id) {
  43. this.id = id;
  44. }
  45.  
  46. public String getTitle() {
  47. return title;
  48. }
  49.  
  50. public void setTitle(String title) {
  51. this.title = title;
  52. }
  53.  
  54. public String getDuration() {
  55. return duration;
  56. }
  57.  
  58. public void setDuration(String duration) {
  59. this.duration = duration;
  60. }
  61.  
  62. public String getRank() {
  63. return rank;
  64. }
  65.  
  66. public void setRank(String rank) {
  67. this.rank = rank;
  68. }
  69.  
  70. public String getPreview() {
  71. return preview;
  72. }
  73.  
  74. public void setPreview(String preview) {
  75. this.preview = preview;
  76. }
  77.  
  78. public boolean isEnabled() {
  79. return enabled;
  80. }
  81.  
  82. public void setEnabled(boolean enabled) {
  83. this.enabled = enabled;
  84. }
  85.  
  86. public Artist getArtist() {
  87. return artist;
  88. }
  89.  
  90. public void setArtist(Artist artist) {
  91. this.artist = artist;
  92. }
  93.  
  94. public Album getAlbum() {
  95. return album;
  96. }
  97.  
  98. public void setAlbum(Album album) {
  99. this.album = album;
  100. }
  101.  
  102. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement