Advertisement
Guest User

Untitled

a guest
Apr 25th, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.80 KB | None | 0 0
  1. package softuniGallery.entity;
  2.  
  3. import javax.persistence.*;
  4.  
  5. @Entity
  6. @Table(name = "links")
  7. public class Link {
  8.  
  9. private Integer id;
  10.  
  11. private String link;
  12.  
  13. private String content;
  14.  
  15. private User author;
  16.  
  17. private LinkCategory linkCategory;
  18.  
  19. @Transient
  20. private String linkSummary;
  21.  
  22. @Id
  23. @GeneratedValue(strategy = GenerationType.IDENTITY)
  24. public Integer getId() {
  25. return this.id;
  26. }
  27.  
  28. public void setId(Integer id) {
  29. this.id = id;
  30. }
  31.  
  32. @Column(columnDefinition = "text", nullable = false)
  33. public String getLink() {
  34. return this.link;
  35. }
  36.  
  37. public void setLink(String link) {
  38. this.link = link;
  39. }
  40.  
  41. @Column(columnDefinition = "text", nullable = false)
  42. public String getContent() {
  43. return this.content;
  44. }
  45.  
  46. public void setContent(String content) {
  47. this.content = content;
  48. }
  49.  
  50. @ManyToOne()
  51. @JoinColumn(nullable = false, name = "authorId")
  52. public User getAuthor() {
  53. return this.author;
  54. }
  55.  
  56. public void setAuthor(User author) {
  57. this.author = author;
  58. }
  59.  
  60. @ManyToOne()
  61. @JoinColumn(nullable = false, name = "categoryId")
  62. public LinkCategory getLinkCategory() {
  63. return this.linkCategory;
  64. }
  65.  
  66. public void setLinkCategory(LinkCategory linkCategory) {
  67. this.linkCategory = linkCategory;
  68. }
  69.  
  70. @Transient
  71. public String getLinkSummary() {
  72. return this.linkSummary;
  73. }
  74.  
  75. public void setLinkSummary(String linkSummary) {
  76.  
  77. this.linkSummary = linkSummary;
  78. }
  79.  
  80. public Link(String link, String content, User author) {
  81. this.link = link;
  82. this.content = content;
  83. this.author = author;
  84. }
  85.  
  86. public Link() {
  87.  
  88. }
  89.  
  90. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement