在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; } |
按照以上的设置实体类的注解就搞定了。
分享到:
相关推荐
hibernate annotation中文文档
hibernate annotation 中文文档
hibernate annotation hibernate3
现在我们公司在做web项目的时候,已经不用*.hbm.xml这种映射文件了,都是用Annotation(注解)方式来完成实体与表之间的映射关系,这样看起来比用xml文件来映射更具有可读性,自我感觉以后Hibernate Annotation的...
hibernate 注解 annotation 教程
Hibernate Annotation 笔记 总结 注解 注解事务,声明事务,详解。
hibernate annotation 注解编程 官网文档 hibernate annotation 注解编程 官网文档 hibernate annotation 注解编程 官网文档
逐渐的Hibernate Annotation的映射方式也越来越盛行,相信过不了多久有可能会取代*.hbm.xml映射方式
很全的Hibernate Annotation API文档,页面也很漂亮,太强大了。真的很实用!我以前找了好多,都不全,这个真的很不错,推荐一下。
HibernateAnnotation注解 api手册
简介: 在过去几年里,Hibernate不断发展,...Hibernate annotation使用了ejb JPA的注解,所以,下面安装配置hibernate annotation环境时,需要导入ejb的包。许多网上的资料都是jpa hibernate annotation方面的资料。
hibernate annotation库所需要引入的三个jar包。
hibernate annotation spring 中文参考文档
Hibernate Annotation
通过HibernateAnnotation技术就不用xml文件了
Hibernate annotation 3.4 api CHM
学习JPA——Hibernate_Annotation使用实例学习JPA——Hibernate_Annotation使用实例学习JPA——Hibernate_Annotation使用实例
hibernate中文的annotation使用说明,网上截下来的,希望对你有用
hibernate annotation3.3 api 文档