@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "restId", nullable = false)
private Long restId;
@Column(name = "rest_name")
private String restName;
@Column(name = "rest_address")
private String restAddress;
@Column(name = "contact_info")
private String contInfo;
@OneToMany(mappedBy = "registerRestaurant", cascade = CascadeType.ALL)
private List<OperatingTimeForRestrotant> openingHour;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name="operatingTime_id")
private Long operatingTime;
@OneToOne(mappedBy = "operatingTime", cascade = CascadeType.ALL)
private DayOfWeek dayOfWeek;
@Column(name="opening_time")
private Timestamp openingTime;
@Column(name="closing_time")
private Timestamp closingTime;
@ManyToOne
@JoinColumn(name = “restId”, nullable=false)
private RegisterRestrutant registerRestaurant;
but this issue org.springframework.dao.DataIntegrityViolationException: could not execute statement [Column ‘rest_id’ cannot be null] [insert into operating_time_for_restrotant
how resolve this .
New contributor
Pappu thakur is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.