From f0e89184a4994ea09ebd272a775ba3efa85bcbbd Mon Sep 17 00:00:00 2001 From: Marc Beyer Date: Sat, 27 Nov 2021 19:23:44 +0100 Subject: [PATCH] Added column annotations to data classes --- server/src/main/java/com/vpr/server/Event.java | 11 +++++++++++ server/src/main/java/com/vpr/server/User.java | 9 +++++++++ 2 files changed, 20 insertions(+) diff --git a/server/src/main/java/com/vpr/server/Event.java b/server/src/main/java/com/vpr/server/Event.java index 2ba66d5..6a1fcd6 100644 --- a/server/src/main/java/com/vpr/server/Event.java +++ b/server/src/main/java/com/vpr/server/Event.java @@ -12,11 +12,22 @@ public class Event { @GeneratedValue(strategy=GenerationType.IDENTITY) private long id; + @Column(name="name", nullable=false) private String name; + + @Column(name="priority", nullable=false) private Integer priority; + + @Column(name="is_full_day", nullable=false) private boolean isFullDay; + + @Column(name="is_private", nullable=false) private boolean isPrivate; + + @Column(name="start") private Time start; + + @Column(name="end") private Time end; @OneToMany(mappedBy = "event") diff --git a/server/src/main/java/com/vpr/server/User.java b/server/src/main/java/com/vpr/server/User.java index 7b4fa04..0f00fe6 100644 --- a/server/src/main/java/com/vpr/server/User.java +++ b/server/src/main/java/com/vpr/server/User.java @@ -11,10 +11,19 @@ public class User { @GeneratedValue(strategy=GenerationType.IDENTITY) private long id; + @Column(name="name", nullable=false) private String name; + + @Column(name="forename", nullable=false) private String forename; + + @Column(name="password", nullable=false) private String password; + + @Column(name="token") private String token; + + @Column(name="is_admin", nullable=false) private boolean isAdmin; @OneToMany(mappedBy = "user")