在hibernate Annotation
中,實(shí)體BLOB
、CLOB
類型的注解與普通的實(shí)體屬性有些不同,具體操作如下:BLOB
類型,類型聲明為byte[]
:
注解:
@Lob
@Basic(fetch = FetchType.LAZY)
@Column(name = "CONTENT", columnDefinition = "BLOB",nullable=true)
public byte[] getContent() {
return this.content;
}
public void setContent(byte[] content) {
this.content = content;
}
|
CLOB類型,類型聲明為String即可:
注解:
@Lob
@Basic(fetch = FetchType.EAGER)
@Column(name="REMARK", columnDefinition="CLOB", nullable=true)
public String getRemark() {
return this.remark;
}
public void setRemark(String recvdocRemark) {
this.remark = remark;
}
|
posted on 2009-02-10 16:24
周銳 閱讀(1048)
評(píng)論(0) 編輯 收藏 所屬分類:
Hibernate