在hibernate Annotation
中,实体BLOB
、CLOB
类型的注解与普通的实体属性有些不同,具体操作如下: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
周锐 阅读(1030)
评论(0) 编辑 收藏 所属分类:
Hibernate