Hibernate Annotation中BLOB、CLOB注解写法
来源:互联网 发布:apache zip jar 编辑:程序博客网 时间:2024/05/23 16:02
在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即可:
private String remark;
注解:
@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;
}
按照以上的设置实体类的注解就搞定了。
//简单类型 默认 fetchType 为 EAGER
private byte[] content;
注解:@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即可:
private String remark;
注解:
@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;
}
按照以上的设置实体类的注解就搞定了。
0 0
- Hibernate Annotation中BLOB、CLOB注解写法
- Hibernate Annotation中BLOB、CLOB注解写法
- Hibernate Annotation中BLOB、CLOB注解写法
- Hibernate Annotation中BLOB、CLOB注解写法
- Hibernate Annotation中BLOB、CLOB注解写法
- Hibernate Annotation中BLOB、CLOB注解写法
- Hibernate or JPA Annotation中BLOB、CLOB注解写法
- hibernate Annotation中,实体BLOB、CLOB类型的注解
- Hibernate的Annotation中实体BLOB、CLOB类型的注解
- Hibernate的Annotation中实体BLOB、CLOB类型的注解
- Hibernate ORM映射中关clob及blob类型对应bo类 注解写法
- hibernate blob和clob注解@Lob
- java 里hibernate 注解 clob blob
- hibernate blob和clob注解@Lob
- 关于oracle blob类型、clob类型在hibernate 中如何使用注解
- hibernate 写入 clob, Blob
- Hibernate Blob和Clob
- Hibernate 操作Blob Clob
- Sqoop
- Python装饰器真的只是语法糖吗?
- hdoj--3530 Subsequence(单调队列)
- Server将表单数据获取并返给Client
- Spring通过实现getBean方法获得Bean的实例
- Hibernate Annotation中BLOB、CLOB注解写法
- C#中如何申明固定长度的数组
- zookeeper
- 我是一名程序猿,我喜欢走在路上的感觉。
- Github for windows的使用
- 跟我一起学习MySQL技术内幕(第五版):(第二章学习日记13)
- Solr
- JSONObject的fromObject
- Linux 兴趣小组2016免试题 第四关揭秘