First of all Hi to all!
I try to use hibernate annotation, postgres DB, and jboss to create a entity with a field of byte[]
like this:
Code:
@Entity
public class Allegato implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@Column(length = 255, nullable = false)
private String filename;
@Column(nullable = false)
private int filesize;
@Lob
@Column(nullable = false, length = 10485760)
@Basic(fetch = FetchType.LAZY)
private byte[] data;
@Column(length = 255)
private String contentType;
...
... many get and set method ...
...
}
When i create a entity like that type and persist the object it all work. Good!
But if found try to remove that object from db I saw that only the row in the "Allegato" table is delete, while if i watch in the table pg_largeobject of postgres db the row about my byte[] field entity persist!
It seem that only the refer about the entity to be canceled, while the real byte data remain in to the db
Can somebody help me about this?