Let's start from the Hibernate's doc:
@Lob indicates that the property should be persisted in a Blob or a Clob depending on the property type: java.sql.Clob, Character[], char[] and java.lang.String will be persisted in a Clob. java.sql.Blob, Byte[], byte[] and serializable type will be persisted in a Blob.
For example:
@Lob
public String getFullText() {
return fullText;
}
@Lob
public byte[] getFullCode() {
return fullCode;
}
Knowing this, it could mean that the object is not in the database. Maybe it was deleted from the table but in a referenced table didn't. Let's say that from the table Blobs
, the blob with id
5 were deleted, but in the table users_blobs
it is stille referenced like:
| user_id | blob_id|
| 4 | 5 | //This entry blob were delete but is still referenced by that table
| 5 | 2 |
If that's the case, you should redefine your users_blobs
(for example) constraints so it will be deleted or put null
if blob is deleted.
Also, this link could be useful too: