I assume that you want to make class Image
an Hibernate Entity in order to store it in the database.
This will not work, because of its field private MultipartFile image_file;
. I highly doubt that you can store this field with hibernate. So instead of having this filed, replace it with an byte array. And Populate this byte array with the content of the Multipart file.
public class Image
{
//some primary key required.
private int id;
private String image_size;
private String image_type;
private byte[] image_content;
private String image_file_url;
private String image_status;
// Getters and Setters
//Constructor without parameter required.
public Image() {}
public void applyImgContent(MultipartFile upload) {
this.image_conten = upload.getBytes();
}
}