package com.leevilehtonen.cookagram.domain;

import org.springframework.data.jpa.domain.AbstractPersistable;

import javax.persistence.Entity;
import javax.persistence.Lob;

@Entity
public class ImageEntity extends AbstractPersistable<Long> {

    private String name;
    private String mediaType;
    private Long size;

    @Lob
    private byte[] content;

    public byte[] getContent() {
        return content;
    }

    public void setContent(byte[] content) {
        this.content = content;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getMediaType() {
        return mediaType;
    }

    public void setMediaType(String mediaType) {
        this.mediaType = mediaType;
    }

    public Long getSize() {
        return size;
    }

    public void setSize(Long size) {
        this.size = size;
    }
}

@@ -38,16 +38,55 @@
 omain;%0A%0A
+import org.hibernate.annotations.Type;%0A
 import o
@@ -141,16 +141,16 @@
 stable;%0A
-
 %0Aimport 
@@ -178,38 +178,8 @@
 ity;
-%0Aimport javax.persistence.Lob;
 %0A%0A@E
@@ -334,11 +334,52 @@
    @
-Lob
+Type(type = %22org.hibernate.type.BinaryType%22)
 %0A   

Update image content type for Postgres