欢迎来到天天文库
浏览记录
ID:12053970
大小:67.06 KB
页数:11页
时间:2018-07-15
《hibernate+spring彻底搞定clob、blob的存取》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、Hibernate+Spring彻底搞定Clob、Blob的存取摘要:本文通过一个实例讲述如何通过Spring2+Hibernate3来快捷操作数据库中的Lob字段。环境:Oracle10g、Srping2、Hibernate3、JUint4说明:由于时间紧迫,没有详细写出思路。运行一下例子就明白了。一、创建实体并添加Xdoclet的Hibernate标签/***@authorleizhimin*@hibernate.mappingdefault-lazy="false"*@hibernate.metaattribut
2、e="class-description"value="工作日志"*@hibernate.classtable="rc_gzrz"*/publicclassWorkNote{privateLongid;//标识privateDateworkDate;//日期privateStringweather;//天气privateStringcontent;//日志内容(Clob)privateStringstate;//日志状态privateLongorgId;//机构idprivateLonguserId;//用户idpri
3、vateDatecreateDate;//创建日期privatebyte[]image;//图片publicstaticfinalStringWORKNOTE_BLANK="00";//未填写publicstaticfinalStringWORKNOTE_FULL="11";//已填写/***@hibernate.idgenerator-class="sequence"column="BS"*@hibernate.metaattribute="field-description"value="标识"*@hibernat
4、e.generator-paramname="sequence"value="SEQ_GW"*/publicLonggetId(){returnid;}publicvoidsetId(Longid){this.id=id;}/***@hibernate.propertycolumn="workDate"not-null="false"type="timestamp"*@hibernate.metaattribute="field-description"value="工作日期"*/publicDategetWorkDa
5、te(){returnworkDate;}publicvoidsetWorkDate(DateworkDate){this.workDate=workDate;}/***@hibernate.propertycolumn="weather"not-null="false"length="24"*@hibernate.metaattribute="field-description"value="天气"*/publicStringgetWeather(){returnweather;}publicvoidsetWeath
6、er(Stringweather){this.weather=weather;}/***@hibernate.propertycolumn="content"not-null="false"type="text"*@hibernate.metaattribute="field-description"value="内容"*/publicStringgetContent(){returncontent;}publicvoidsetContent(Stringcontent){this.content=content;}/
7、***@hibernate.propertycolumn="state"not-null="false"length="2"*@hibernate.metaattribute="field-description"value="状态"*/publicStringgetState(){returnstate;}publicvoidsetState(Stringstate){this.state=state;}/***@hibernate.propertycolumn="orgId"type="long"*@hiberna
8、te.metaattribute="field-description"value="机构id"*/publicLonggetOrgId(){returnorgId;}publicvoidsetOrgId(LongorgId){this.orgId=orgId;}/***@hibernate.propertycolumn="use
此文档下载收益归作者所有