Merge branch '91-backend-uses-cascaded-delete-for-entities' into 'master'

Resolve "Backend uses cascaded delete for entities"

Closes #91

See merge request marcel.schwarz/2020ss-qbc-geofence-timetracking!70
This commit is contained in:
Marcel Schwarz 2020-05-25 19:25:42 +00:00
commit 50446e0654
2 changed files with 6 additions and 0 deletions

View File

@ -3,6 +3,8 @@ package de.hft.geotime.entities;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.OnDelete;
import org.hibernate.annotations.OnDeleteAction;
import javax.persistence.*;
import java.time.LocalDateTime;
@ -19,6 +21,7 @@ public class TimeRecord {
private long id;
@ManyToOne
@OnDelete(action = OnDeleteAction.CASCADE)
private TimetrackAccount account;
@Column(columnDefinition = "TIMESTAMP")

View File

@ -4,6 +4,8 @@ import com.fasterxml.jackson.annotation.JsonBackReference;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.OnDelete;
import org.hibernate.annotations.OnDeleteAction;
import javax.persistence.*;
@ -21,6 +23,7 @@ public class TimetrackAccount {
private String description;
@ManyToOne
@OnDelete(action = OnDeleteAction.CASCADE)
private TimetrackUser user;
}