Home  >  Article  >  Database  >  Hibernate注解映射mysql数据库上text类型_MySQL

Hibernate注解映射mysql数据库上text类型_MySQL

WBOY
WBOYOriginal
2016-05-31 08:49:001939browse

Hibernate

@Lob 通常与@Basic同时使用,提高访问速度。 
@Lob 
@Basic(fetch = FetchType.LAZY) 
@Column(name="DtaContent", columnDefinition="CLOB", nullable=true) 
 public String getDtaContent() {
    return dtaContent;
  }

@Basic  实体Bean中所有的非Static 非transient的属性都可以被持久化,没有定义注解属性的等价于在其上添加了@Basic注解 
通过@Basic注解可以声明属性的获取策略(lazy与否),默认的是即时获取(early fetch),这里又讨论到了 
延迟关联获取和延迟属性获取,通常不需要对简单属性设置延迟获取,如需要定义@Basic(fetch=FetchType.LAZY) 
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn