Skip to content

Commit

Permalink
add file Entity Foodanddrink - close #136
Browse files Browse the repository at this point in the history
  • Loading branch information
SaranSmr committed Jan 25, 2020
1 parent 85b4880 commit 917b8a8
Showing 1 changed file with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
Expand All @@ -29,15 +31,19 @@ public class Foodanddrink {
@SequenceGenerator(name="FoodAndDrink_seq",sequenceName="FoodAndDrink_seq")
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator="FoodAndDrink_seq")
@Column(name = "FoodAndDrink_ID", unique = true, nullable = true)
private @NonNull Long id;
@NotNull
private Long id;

@Size(min = 2, max = 60, message = "Note must be between 2 and 60 characters")
private String note;

@ManyToOne(fetch = FetchType.EAGER, targetEntity = User.class)
@JoinColumn(name = "USER_ID", insertable = true)
private User user;

@ManyToOne(fetch = FetchType.EAGER, targetEntity = Drink.class)
@JoinColumn(name = "DRINK_ID", insertable = true)
private Drink drink;
private Drink drink;

@ManyToOne(fetch = FetchType.EAGER, targetEntity = Food.class)
@JoinColumn(name = "FOOD_ID", insertable = true)
Expand All @@ -46,6 +52,7 @@ public class Foodanddrink {
@ManyToOne(fetch = FetchType.EAGER, targetEntity = Employee.class)
@JoinColumn(name = "EMPLOYEE_ID", insertable = true)
private Employee employee;



}
}

0 comments on commit 917b8a8

Please sign in to comment.