用来声明Hibernate描述文件的Tags:
Class层次Tags
@hibernate.class
@hibernate.subclass
@hibernate.discriminator
@hibernate.joined-subclass
@hibernate.joined-subclass-key
@hibernate.cache
@hibernate.jcs-cache
@hibernate.query
方法层次Tags
@hibernate.id
@hibernate.generator-param
@hibernate.property
@hibernate.component
@hibernate.version
@hibernate.timestamp
@hibernate.many-to-one
@hibernate.one-to-one
@hibernate.column
@hibernate.set
@hibernate.bag
@hibernate.list
@hibernate.map
@hibernate.array
@hibernate.primitive-array
@hibernate.collection-key
@hibernate.collection-index
@hibernate.index-many-to-many
@hibernate.collection-element
@hibernate.collection-composite-element
@hibernate.collection-many-to-many
@hibernate.collection-one-to-many
@hibernate.collection-cache
@hibernate.collection-jcs-cache
字段层次Tags
Tag用法, Class层次(@hibernate)
@hibernate.class (0..1)
声明一个持久类
参数
|
类型
|
适用性
|
描述
|
是否必须
|
table
|
text
|
|
数据表名
|
false
|
discriminator-value
|
text
|
|
一个用于区分特殊子类的值
|
false
|
mutable
|
bool
|
|
指定该类的实例是否mutable:true/false
|
false
|
dynamic-update
|
bool
|
|
指定只有改变了的字段出现在SQL UPDATE中
|
false
|
dynamic-insert
|
bool
|
|
指定null字段不应出现在SQL INSERT
|
false
|
polymorphism
|
text
|
|
使"explicit"多态性有效
可选项:
explicit
implicit
|
false
|
schema
|
text
|
|
覆盖schema在hibernate-mapping根元素中指定的名称
|
false
|
proxy
|
text
|
|
为使用CGLIB proxies指定一个接口
|
false
|
@hibernate.subclass (0..1)
声明当前类为子类
参数
|
类型
|
适用性
|
描述
|
是否必须
|
discriminator-value
|
text
|
|
一个用于区分特殊子类的值
|
false
|
proxy
|
text
|
|
为使用CGLIB proxies指定一个接口
|
false
|
dynamic-update
|
bool
|
|
指定只有改变了的字段出现在SQL UPDATE中
|
false
|
dynamic-insert
|
bool
|
|
指定null字段不应出现在SQL INSERT
|
false
|
@hibernate.discriminator (0..1)
Defines a discriminator
参数
|
类型
|
适用性
|
描述
|
是否必须
|
column
|
text
|
|
映射的目标数据表字段
|
true
|
type
|
text
|
|
Hibernate 类型
|
false
|
length
|
text
|
|
映射字段的长度
|
false
|
@hibernate.joined-subclass (0..1)
Declare the current class as joined subclass
参数
|
类型
|
适用性
|
描述
|
是否必须
|
proxy
|
text
|
|
为使用CGLIB proxies指定一个接口
|
false
|
dynamic-update
|
bool
|
|
指定只有改变了的字段出现在SQL UPDATE中
|
false
|
dynamic-insert
|
bool
|
|
指定null字段不应出现在SQL INSERT
|
false
|
schema
|
text
|
|
覆盖schema在hibernate-mapping根元素中指定的名称
|
false
|
@hibernate.joined-subclass-key (0..1)
Declares a joined-subclass key
参数
|
类型
|
适用性
|
描述
|
是否必须
|
column
|
text
|
|
映射的目标数据表字段
|
true
|
@hibernate.cache (0..1)
Enables caching
参数
|
类型
|
适用性
|
描述
|
是否必须
|
usage
|
text
|
|
定义缓冲语义
可选项:
read-write
nonstrict-read-write
read-only
|
true
|
@hibernate.jcs-cache (0..1)
Enables caching (deprecated)
参数
|
类型
|
适用性
|
描述
|
是否必须
|
usage
|
text
|
|
定义缓冲语义.
nonstrict-read-write只应用于版本2.0或者更新的版本.
可选项:
read-write
nonstrict-read-write
read-only
|
true
|
@hibernate.query (0..*)
为类声明一个有名称的查询
参数
|
类型
|
适用性
|
描述
|
是否必须
|
name
|
text
|
|
查询的名称
|
true
|
query
|
text
|
|
查询的内容
|
true
|
Tag Usage, Method Level (@hibernate)
@hibernate.id (0..1)
定义一个id属性
参数
|
类型
|
适用性
|
描述
|
是否必须
|
column
|
text
|
|
映射的目标数据表字段
|
false
|
type
|
text
|
|
Hibernate 类型
|
false
|
length
|
text
|
|
所应设数据库表字段的长度
|
false
|
unsaved-value
|
text
|
|
一个用来从新的transient instances中区分transient instances和已存在的persistent状态的值
|
false
|
generator-class
|
text
|
|
key generator类
可选项:
uu id.hex
uuid.string
increment
assigned
native
identity
sequence
hilo
seqhilo
foreign
|
true
|
@hibernate.generator-param (0..*)
指定id generator 参数和值
参数
|
类型
|
适用性
|
描述
|
是否必须
|
name
|
text
|
|
参数名称
|
true
|
value
|
text
|
|
参数值
|
true
|
@hibernate.property (0..1)
定义一个property
参数
|
类型
|
适用性
|
描述
|
是否必须
|
column
|
text
|
|
映射的目标数据表字段
|
false
|
type
|
text
|
|
Hibernate 类型
|
false
|
length
|
text
|
|
所应设数据库表字段的长度
|
false
|
not-null
|
bool
|
|
字段是否可以为null
|
false
|
unique
|
bool
|
|
字段是否unique
|
false
|
insert
|
bool
|
|
字段是否应该出现在SQL INSERT中
|
false
|
update
|
bool
|
|
字段是否应该出现在SQL UPDATE中
|
false
|
@hibernate.component (0..1)
声明一个component
参数
|
类型
|
适用性
|
描述
|
是否必须
|
class
|
text
|
|
特定类的全名
|
false
|
@hibernate.version (0..1)
Declares a version property
参数
|
类型
|
适用性
|
描述
|
是否必须
|
column
|
text
|
|
存放版本号的字段名称
|
false
|
Type
|
text
|
|
Hibernate 类型
可选项:
integer
short
long
timestamp
calendar
|
false
|
@hibernate.timestamp (0..1)
Declares a timestamp property
参数
|
类型
|
适用性
|
描述
|
是否必须
|
column
|
text
|
|
存放timestamp的字段名称
|
false
|
@hibernate.many-to-one (0..1)
声明一个many-to-one 关系
参数
|
类型
|
适用性
|
描述
|
是否必须
|
column
|
text
|
|
映射的目标数据表字段
|
false
|
class
|
text
|
|
关系类名称
|
false
|
cascade
|
text
|
|
指定从父对象到关联对象有哪些级联操作
可选项:
all
none
save-update
delete
|
false
|
not-null
|
bool
|
|
字段是否可以为null
|
false
|
unique
|
bool
|
|
字段是否unique
|
false
|
outer-join
|
text
|
|
使outer-join fetching有效
可选项:
true
false
auto
|
false
|
insert
|
bool
|
|
字段是否应该出现在SQL INSERT中
|
false
|
update
|
bool
|
|
字段是否应该出现在SQL UPDATE中
|
false
|
@hibernate.one-to-one (0..1)
Declares a one-to-one association
参数
|
类型
|
适用性
|
描述
|
是否必须
|
class
|
text
|
|
关联类
|
false
|
constrained
|
bool
|
|
是否有外键约束
|
false
|
cascade
|
text
|
|
指定从父对象到关联对象有哪些级联操作
可选项:
all
none
save-update
delete
|
false
|
outer-join
|
bool
|
|
如果设置了hibernate.use_outer_join,则使这个关联的outer-join fetching有效
可选项:
true
false
auto
|
false
|
@hibernate.column (0..*)
个性化字段映射
参数
|
类型
|
适用性
|
描述
|
是否必须
|
name
|
text
|
|
字段名
|
true
|
length
|
text
|
|
字段长度
|
false
|
unique
|
bool
|
|
字段是否unique
|
false
|
not-null
|
bool
|
|
字段是否nullable
|
false
|
index
|
text
|
|
Index名称
|
false
|
unique-key
|
text
|
|
Unique约束的名称
|
false
|
sql-type
|
text
|
|
SQL字段类型
|
false
|
@hibernate.set (0..1)
Defines a set
参数
|
类型
|
适用性
|
描述
|
是否必须
|
inverse
|
bool
|
|
是否转置的collection
|
false
|
table
|
text
|
|
角色名称的默认值: Collection表的名称 (不是用于one-to-many关联)
|
false
|
schema
|
text
|
|
用于覆盖已声明schema的表schema名称
|
false
|
lazy
|
bool
|
|
使lazy 初始化有效
|
false
|
cascade
|
text
|
|
指定从父对象到关联对象有哪些级联操作
可选项:
all
none
save-update
delete
|
false
|
sort
|
text
|
|
指定一个排序的collection,该collection应该具有自然的排序顺序或者一个给定的comparator class
|
false
|
order-by
|
text
|
|
指定定义枚举顺序的表字段
|
false
|
where
|
text
|
|
一个SQL WHERE 条件
|
false
|
@hibernate.bag (0..1)
Defines a bag
参数
|
类型
|
适用性
|
描述
|
是否必须
|
inverse
|
bool
|
|
是否转置的collection
|
false
|
table
|
text
|
|
Collection表的名称 (不是用于one-to-many关联)
|
false
|
schema
|
text
|
|
用于覆盖已声明schema的表schema名称
|
false
|
lazy
|
bool
|
|
使lazy 初始化有效
|
false
|
cascade
|
text
|
|
指定从父对象到关联对象有哪些级联操作
可选项:
all
none
save-update
delete
|
false
|
order-by
|
text
|
|
指定定义枚举顺序的表字段
|
false
|
where
|
text
|
|
一个SQL WHERE 条件
|
false
|
@hibernate.list (0..1)
Defines a List
参数
|
类型
|
适用性
|
描述
|
是否必须
|
table
|
text
|
|
Collection表的名称 (不是用于one-to-many关联)
|
false
|
schema
|
text
|
|
用于覆盖已声明schema的表schema名称
|
false
|
lazy
|
bool
|
|
使lazy 初始化有效
|
false
|
cascade
|
text
|
|
指定从父对象到关联对象有哪些级联操作
可选项:
all
none
save-update
delete
|
false
|
where
|
text
|
|
一个SQL WHERE 条件
|
false
|
@hibernate.map (0..1)
Defines a map
参数
|
类型
|
适用性
|
描述
|
是否必须
|
table
|
text
|
|
Collection表的名称 (不是用于one-to-many关联)
|
false
|
schema
|
text
|
|
用于覆盖已声明schema的表schema名称
|
false
|
lazy
|
bool
|
|
使lazy 初始化有效
|
false
|
cascade
|
text
|
|
指定从父对象到关联对象有哪些级联操作
可选项:
all
save-update
delete
none
|
false
|
sort
|
text
|
|
指定一个排序的collection,该collection应该具有自然的排序顺序或者一个给定的comparator class
|
false
|
order-by
|
text
|
|
声明定义枚举顺序的表的字段
|
false
|
where
|
text
|
|
一个SQL WHERE条件
|
false
|
@hibernate.array (0..1)
Defines an array
参数
|
类型
|
适用性
|
描述
|
是否必须
|
table
|
text
|
|
Collection表的名称 (不是用于one-to-many关联)
|
false
|
schema
|
text
|
|
为了覆盖已声明schema的表schema的名称
|
false
|
cascade
|
text
|
|
指定从父对象到关联对象有哪些级联操作
可选项:
all
none
save-update
delete
|
false
|
where
|
text
|
|
一个SQL WHERE条件
|
false
|
@hibernate.primitive-array (0..1)
声明一个primitive-array
参数
|
类型
|
适用性
|
描述
|
是否必须
|
table
|
text
|
|
Collection表的名称 (不是用于one-to-many关联)
|
false
|
schema
|
text
|
|
The name of a table schema to override the schema declared
|
false
|
cascade
|
text
|
|
指定从父对象到关联对象有哪些级联操作
可选项:
all
none
save-update
delete
|
false
|
本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
| |