Usage Notes
If using JPA/Eclipselink, Blob properties can be mapped using the BlobJpaEmbeddable:
@AttributeOverrides({
@AttributeOverride(name="name", column=@Column(name="attachment_name")),
@AttributeOverride(name="mimeType",column=@Column(name="attachment_mimeType")),
@AttributeOverride(name="bytes", column=@Column(name="attachment_bytes"))
})
@Embedded
private BlobJpaEmbeddable attachment;
@Property()
@PropertyLayout()
public Blob getPdf() {
return BlobJpaEmbeddable.toBlob(pdf);
}
public void setPdf(final Blob pdf) {
this.pdf = BlobJpaEmbeddable.fromBlob(pdf);
}