From 3c0c09c37568b0550378010e3d02dcfe7367b70d Mon Sep 17 00:00:00 2001 From: tommi27 Date: Tue, 25 Feb 2020 16:23:12 +0100 Subject: [PATCH] added image and icon fields to Room --- .../inf/sa4/sanmarinoes/smarthut/models/Room.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/Room.java b/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/Room.java index ec732b1..6f36557 100644 --- a/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/Room.java +++ b/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/Room.java @@ -12,6 +12,18 @@ public class Room { @Column(name = "id", updatable = false, nullable = false) private Long id; + /** + * Icon and image are to be given as byte[]. In order to get an encoded string from it, the + * Base64.getEncoder().encodeToString(byte[] content) should be used. For further information: + * https://www.baeldung.com/java-base64-image-string + * https://docs.oracle.com/javase/8/docs/api/java/util/Base64.html + */ + @Column(name = "icon", updatable = true, nullable = false) + private byte[] icon; + + @Column(name = "image", updatable = true, nullable = false) + private byte[] image; + /** User that owns the house this room is in */ @ManyToOne @JoinColumn(name = "user_id")