added image and icon fields to Room

This commit is contained in:
Tommaso Rodolfo Masera 2020-02-25 16:23:12 +01:00
parent a3128b7cb7
commit 3c0c09c375

View File

@ -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")