From 5102408f6ebc93056894de6d15d0cd18418ac64f Mon Sep 17 00:00:00 2001 From: Pelayori <31128562+Pelayori@users.noreply.github.com> Date: Tue, 5 Mar 2024 00:45:33 +0100 Subject: [PATCH] Test fix for sql generation --- src/main/java/com/uniovi/entities/ApiKey.java | 2 +- src/main/java/com/uniovi/entities/Player.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/uniovi/entities/ApiKey.java b/src/main/java/com/uniovi/entities/ApiKey.java index ae52345f..464ff90f 100644 --- a/src/main/java/com/uniovi/entities/ApiKey.java +++ b/src/main/java/com/uniovi/entities/ApiKey.java @@ -21,7 +21,7 @@ public class ApiKey { @Column(unique = true) private String key = UUID.randomUUID().toString(); - @OneToOne(mappedBy = "apiKey") + @OneToOne private Player player; @OneToMany(mappedBy = "apiKey") diff --git a/src/main/java/com/uniovi/entities/Player.java b/src/main/java/com/uniovi/entities/Player.java index 4ee6d958..2575c789 100644 --- a/src/main/java/com/uniovi/entities/Player.java +++ b/src/main/java/com/uniovi/entities/Player.java @@ -39,7 +39,7 @@ public class Player implements JsonEntity { @OneToMany(mappedBy = "player", cascade = CascadeType.REMOVE) private Set gameSessions = new HashSet<>(); - @OneToOne(cascade = CascadeType.PERSIST, mappedBy = "player") + @OneToOne(cascade = CascadeType.ALL, mappedBy = "player") private ApiKey apiKey; // Transient: no se almacena en la base de datos