Implement removeStop() and find() (2.1.1.1)

This commit is contained in:
2021-04-27 15:03:12 +02:00
parent b19a2d2ca2
commit 852527755c
2 changed files with 50 additions and 8 deletions
@@ -3,6 +3,7 @@ package dst.ass1.jpa.model.impl;
import dst.ass1.jpa.model.IPreferences;
import dst.ass1.jpa.model.IRider;
import dst.ass1.jpa.model.ITrip;
import org.hibernate.annotations.Cascade;
import javax.persistence.*;
import java.util.ArrayList;
@@ -35,6 +36,8 @@ public class Rider extends PlatformUser implements IRider {
@JoinColumn(name = I_PREFERENCES, unique = true)
private IPreferences preferences;
@Cascade(org.hibernate.annotations.CascadeType.ALL)
@JoinColumn(name = I_TRIP)
@OneToMany(targetEntity = Trip.class)
private Collection<ITrip> trips = new ArrayList<>();