I have a Spring application which uses Hibernate on a PostgreSQL database. I\'m trying to store files in a table of the database. It seems it stores the row with the file (I
Instead of using @Transactional
, all I did for this issue was to update this column in PostgreSQL DB from oid
type to bytea
type and added @Type
for the @Lob
field.
i.e.
ALTER TABLE person DROP COLUMN image;
ALTER TABLE person ADD COLUMN image bytea;
And changed
@Lob
private byte[] image;
To
@Lob
@Type(type = "org.hibernate.type.ImageType")
private byte[] image;