在hibernate Annotation中实体BLOBCLOB类型的注解与普通的实体属性有些不同具体操作如下BLOB类型类型声明为byte[]
private byte[] content
注解
@Lob
@Basic(fetch = FetchTypeLAZY)
@Column(name = CONTENT columnDefinition = BLOBnullable=true)
public byte[] getContent() {
return ntent;
}
public void setContent(byte[] content) {
ntent = content;
}
CLOB类型类型声明为String即可
private String remark
注解
@Lob
@Basic(fetch = FetchTypeEAGER)
@Column(name=REMARK columnDefinition=CLOB nullable=true)
public String getRemark() {
return thisremark;
}
public void setRemark(String recvdocRemark) {
thisremark = remark;
}
按照以上的设置实体类的注解就搞定了