[AB-62] adding server id to more tables for easier joins and fixing structure at more places

This commit is contained in:
Sheldan
2021-02-08 01:58:35 +01:00
parent 1352fac40f
commit ea12d67e5f
46 changed files with 188 additions and 150 deletions

View File

@@ -27,7 +27,7 @@ public class AllowedInviteLink {
@Column(name = "code")
private String code;
@OneToOne(fetch = FetchType.LAZY)
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "server_id", nullable = false)
private AServer server;

View File

@@ -27,7 +27,7 @@ public class FilteredInviteLink {
@Column(name = "code")
private String code;
@OneToOne(fetch = FetchType.LAZY)
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "server_id", nullable = false)
private AServer server;

View File

@@ -40,14 +40,14 @@ public class Mute implements Serializable {
/**
* The {@link AUserInAServer} which was muted
*/
@ManyToOne
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "muted_user_in_server_id", nullable = false)
private AUserInAServer mutedUser;
/**
* The {@link AUserInAServer} which casted the mute
*/
@ManyToOne
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "muting_user_in_server_id", nullable = false)
private AUserInAServer mutingUser;
@@ -84,7 +84,7 @@ public class Mute implements Serializable {
/**
* The channel in which this mute was cast
*/
@ManyToOne
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "mutingChannel", nullable = false)
private AChannel mutingChannel;

View File

@@ -30,7 +30,7 @@ public class UserNote implements Serializable {
@JoinColumn(name = "server_id", referencedColumnName = "id", nullable = false)
private AServer server;
@ManyToOne
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "user_in_server_id", nullable = false)
private AUserInAServer user;

View File

@@ -41,7 +41,7 @@ public class Warning implements Serializable {
*/
@Getter
@Setter
@ManyToOne
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "warned_user_in_server_id", nullable = false)
private AUserInAServer warnedUser;
@@ -50,7 +50,7 @@ public class Warning implements Serializable {
*/
@Getter
@Setter
@ManyToOne
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "warning_user_in_server_id", nullable = false)
private AUserInAServer warningUser;