|
| 1 | +package guru.springframework.domain; |
| 2 | + |
| 3 | +import javax.persistence.CascadeType; |
| 4 | +import javax.persistence.Entity; |
| 5 | +import javax.persistence.GeneratedValue; |
| 6 | +import javax.persistence.GenerationType; |
| 7 | +import javax.persistence.Id; |
| 8 | +import javax.persistence.Lob; |
| 9 | +import javax.persistence.OneToOne; |
| 10 | + |
| 11 | +@Entity |
| 12 | +public class Recipe { |
| 13 | + |
| 14 | + @Id |
| 15 | + @GeneratedValue(strategy = GenerationType.IDENTITY) |
| 16 | + private Long id; |
| 17 | + |
| 18 | + private String description; |
| 19 | + private Integer prepTime; |
| 20 | + private Integer cookTime; |
| 21 | + private Integer servings; |
| 22 | + private String source; |
| 23 | + private String url; |
| 24 | + private String directions; |
| 25 | + //todo add |
| 26 | + |
| 27 | + @Lob |
| 28 | + private Byte[] image; |
| 29 | + |
| 30 | + @OneToOne(cascade = CascadeType.ALL) |
| 31 | + private Notes notes; |
| 32 | + |
| 33 | + |
| 34 | + public Long getId() { |
| 35 | + return this.id; |
| 36 | + } |
| 37 | + |
| 38 | + public void setId(Long id) { |
| 39 | + this.id = id; |
| 40 | + } |
| 41 | + |
| 42 | + public String getDescription() { |
| 43 | + return this.description; |
| 44 | + } |
| 45 | + |
| 46 | + public void setDescription(String description) { |
| 47 | + this.description = description; |
| 48 | + } |
| 49 | + |
| 50 | + public Integer getPrepTime() { |
| 51 | + return this.prepTime; |
| 52 | + } |
| 53 | + |
| 54 | + public void setPrepTime(Integer prepTime) { |
| 55 | + this.prepTime = prepTime; |
| 56 | + } |
| 57 | + |
| 58 | + public Integer getCookTime() { |
| 59 | + return this.cookTime; |
| 60 | + } |
| 61 | + |
| 62 | + public void setCookTime(Integer cookTime) { |
| 63 | + this.cookTime = cookTime; |
| 64 | + } |
| 65 | + |
| 66 | + public Integer getServings() { |
| 67 | + return this.servings; |
| 68 | + } |
| 69 | + |
| 70 | + public void setServings(Integer servings) { |
| 71 | + this.servings = servings; |
| 72 | + } |
| 73 | + |
| 74 | + public String getSource() { |
| 75 | + return this.source; |
| 76 | + } |
| 77 | + |
| 78 | + public void setSource(String source) { |
| 79 | + this.source = source; |
| 80 | + } |
| 81 | + |
| 82 | + public String getUrl() { |
| 83 | + return this.url; |
| 84 | + } |
| 85 | + |
| 86 | + public void setUrl(String url) { |
| 87 | + this.url = url; |
| 88 | + } |
| 89 | + |
| 90 | + public String getDirections() { |
| 91 | + return this.directions; |
| 92 | + } |
| 93 | + |
| 94 | + public void setDirections(String directions) { |
| 95 | + this.directions = directions; |
| 96 | + } |
| 97 | + |
| 98 | + public Byte[] getImage() { |
| 99 | + return this.image; |
| 100 | + } |
| 101 | + |
| 102 | + public void setImage(Byte[] image) { |
| 103 | + this.image = image; |
| 104 | + } |
| 105 | + |
| 106 | + public Notes getNotes() { |
| 107 | + return this.notes; |
| 108 | + } |
| 109 | + |
| 110 | + public void setNotes(Notes notes) { |
| 111 | + this.notes = notes; |
| 112 | + } |
| 113 | + |
| 114 | + |
| 115 | +} |
0 commit comments