在hibernate Annotation中,实体BLOB、CLOB类型的注解与普通的实体属性有些不同,具体操作如下:BLOB类型,类型声明为byte[]:
  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;
  }

 

相关文章:

  • 2021-11-04
  • 2021-08-05
  • 2021-09-14
  • 2022-12-23
  • 2022-02-01
  • 2022-12-23
  • 2021-12-07
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-10
相关资源
相似解决方案