@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;
また、このクラスのマッピングを持っている(のMySQLへの)休止状態の助けを借りて、画像を保存するための最良の方法 であるかを知りたい
て画像を取得します。 Imageを保存して取得するためにMy PictureDAOを実装する方法を知りたい
myBlobAttribute値の設定/取得はそれを行いません。どのエラーがありますか?何を試しましたか? em.persist(エンティティ)、em.find(エンティティ、id) –