注解属性将被持久化为 Blog 或 Clob 类型。具体的java.sql.Clob, Character[], char[] 和 java.lang.String 将被持久化为 Clob 类型. java.sql.Blob, Byte[], byte[] 和 serializable type 将被持久化为 Blob 类型。
持久化为Blob或者Clob类型,根据get方法的不同,自动进行Clob和Blob的转换
public String getFullText() {
return fullText; // clob type
}
public byte[] getFullCode() {
return fullCode; // blog type
}
通常与同时使用,提高访问速度。
(fetch = FetchType.LAZY)
(name="DtaContent", columnDefinition="TEXT", nullable=true)
public String getDtaContent() {
return dtaContent;
}
实体Bean中所有的非Static 非transient的属性都可以被持久化,没有定义注解属性的等价于在其上添加了注解 通过注解可以声明属性的获取策略(lazy与否),默认的是即时获取(early fetch),这里又讨论到了 延迟关联获取和延迟属性获取,通常不需要对简单属性设置延迟获取,如需要定义 (fetch=FetchType.LAZY)
Hibernate注解映射类型
原创
©著作权归作者所有:来自51CTO博客作者冰河技术的原创作品,请联系作者获取转载授权,否则将追究法律责任
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
Hibernate 映射 数据类型
Hibernate API简介其接口分为以下几类:l 提供访问数据库的操作的接口;l 用于配置Hibernate的接口;l
职场 数据类型 Hibernate 休闲 -
Hibernate的映射类型(转)
应字段。 一、Hibernate的内置映射类...
Hibernate Java SQL Oracle MySQL -
Hibernate 映射类型与Java 类型对照
Hibernate 映射类型与Java 类型对照
职场 hibernate 休闲 类型映射对照 -
java 有序的线程安全的集合
遍历List的多种方式在讲如何线程安全地遍历 List 之前,先看看遍历一个 List 通常会采用哪些方式。方式一: for(int i = 0; i < list.size(); i++) { System.out.println(list.get(i)); } 方式二: Iterator iterator = list.iterator(); while(it
java 有序的线程安全的集合 java 线程安全list java 线程安全的list java8 list 去重 java8 list去重