Hi every One, can any one tell me what is the best way to store and Image By hibernate (into MySQL) I have this class Mapping
@Entity
@Table(name = "picture")
public class PictureEntity implements Serializable {
@Id
@Column(name = "id")
@GeneratedValue
private int id;
@Column(name = "format", length = 8)
private String format;
//@Basic(fetch = FetchType.LAZY)
@Lob
@Column(name = "context", nullable = true, columnDefinition = "mediumblob")
private java.sql.Blob myBlobAttribute; // or byte[] no diff
@ManyToOne(fetch = FetchType.EAGER)
@JoinColumn(name = "branch_fk", referencedColumnName = "id", nullable = false)
private BranchEntity branch;
and also have PictureDAO I wanna know How shoud I implement My PictureDAO to save and retrieve Image.