Hi,
I want to persit a photo of a person in my database. In order to do that, I'am using the code below:
@Entity @Table(name="PERSONNE") @Inheritance(strategy=InheritanceType.JOINED) public class Personne implements Serializable{ private ImageIcon photo; ... @Lob @Basic(fetch=FetchType.LAZY,optional=true) @Column(name="PHOTO") public ImageIcon getPhoto() {return photo;} public void setPhoto(ImageIcon photo) {this.photo = photo;} ... }
I solved the problem by simply using @Column wtih columnDefinition="LONGBLOB".
For your information, I found out that it is not the Blob type which limits the data size. If the type of the table is MyISAM, each line cannot exceed 64KB.
Bye