Commit 77e4ec8f authored by Ondřej Pavlica's avatar Ondřej Pavlica
Browse files

Wine bottle cascading fixes

parent cb57e13d
Pipeline #139576 passed with stages
in 2 minutes and 35 seconds
......@@ -2,7 +2,7 @@
PA165 course at MUNI Spring 2022.
# Build and Run Tests
# Build, Run Tests, and Launch the Web Application
Assuming you are in the root directory of this project:
```bash
......@@ -19,7 +19,7 @@ Password: `admin`
E-mail: `user@winery.com`
Password: `user`
# About Project
# About the Project
- **Name**: Winery Management System
- **Technologies**: Java 11, Spring, Hibernate, Maven
......
......@@ -5,6 +5,7 @@ import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.ManyToOne;
......
......@@ -70,4 +70,10 @@ public class WineBottle extends EntityBase{
@ManyToOne
@NotNull
private Grape grape;
/**
* The reviews of this wine bottle
*/
@OneToMany(mappedBy = "wineBottle", fetch = FetchType.EAGER, cascade = CascadeType.REMOVE)
private Set<ProductReview> reviews = new HashSet<>();
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment