用來(lái)聲明Hibernate描述文件的Tags:
Class層次Tags
@hibernate.joined-subclass-key
方法層次Tags
@hibernate.collection-composite-element
@hibernate.collection-many-to-many
@hibernate.collection-one-to-many
@hibernate.collection-jcs-cache
字段層次Tags
Tag用法, Class層次(@hibernate)
聲明一個(gè)持久類(lèi)
參數 | 類(lèi)型 | 適用性 | 描述 | 是否必須 |
table | text |
| 數據表名 | false |
discriminator-value | text |
| 一個(gè)用于區分特殊子類(lèi)的值 | false |
mutable | bool |
| 指定該類(lèi)的實(shí)例是否mutable:true/false | false |
dynamic-update | bool |
| 指定只有改變了的字段出現在SQL UPDATE中 | false |
dynamic-insert | bool |
| 指定null字段不應出現在SQL INSERT | false |
polymorphism | text |
| 使"explicit"多態(tài)性有效 可選項: explicit implicit | false |
schema | text |
| 覆蓋schema在hibernate-mapping根元素中指定的名稱(chēng) | false |
proxy | text |
| 為使用CGLIB proxies指定一個(gè)接口 | false |
聲明當前類(lèi)為子類(lèi)
參數 | 類(lèi)型 | 適用性 | 描述 | 是否必須 |
discriminator-value | text |
| 一個(gè)用于區分特殊子類(lèi)的值 | false |
proxy | text |
| 為使用CGLIB proxies指定一個(gè)接口 | false |
dynamic-update | bool |
| 指定只有改變了的字段出現在SQL UPDATE中 | false |
dynamic-insert | bool |
| 指定null字段不應出現在SQL INSERT | false |
@hibernate.discriminator (0..1)
Defines a discriminator
參數 | 類(lèi)型 | 適用性 | 描述 | 是否必須 |
column | text |
| 映射的目標數據表字段 | true |
type | text |
| Hibernate 類(lèi)型 | false |
length | text |
| 映射字段的長(cháng)度 | false |
@hibernate.joined-subclass (0..1)
Declare the current class as joined subclass
參數 | 類(lèi)型 | 適用性 | 描述 | 是否必須 |
proxy | text |
| 為使用CGLIB proxies指定一個(gè)接口 | false |
dynamic-update | bool |
| 指定只有改變了的字段出現在SQL UPDATE中 | false |
dynamic-insert | bool |
| 指定null字段不應出現在SQL INSERT | false |
schema | text |
| 覆蓋schema在hibernate-mapping根元素中指定的名稱(chēng) | false |
@hibernate.joined-subclass-key (0..1)
Declares a joined-subclass key
參數 | 類(lèi)型 | 適用性 | 描述 | 是否必須 |
column | text |
| 映射的目標數據表字段 | true |
Enables caching
參數 | 類(lèi)型 | 適用性 | 描述 | 是否必須 |
usage | text |
| 定義緩沖語(yǔ)義 可選項: read-write nonstrict-read-write read-only | true |
Enables caching (deprecated)
參數 | 類(lèi)型 | 適用性 | 描述 | 是否必須 |
usage | text |
| 定義緩沖語(yǔ)義. nonstrict-read-write只應用于版本2.0或者更新的版本. 可選項: read-write nonstrict-read-write read-only | true |
為類(lèi)聲明一個(gè)有名稱(chēng)的查詢(xún)
參數 | 類(lèi)型 | 適用性 | 描述 | 是否必須 |
name | text |
| 查詢(xún)的名稱(chēng) | true |
query | text |
| 查詢(xún)的內容 | true |
Tag Usage, Method Level (@hibernate)
定義一個(gè)id屬性
參數 | 類(lèi)型 | 適用性 | 描述 | 是否必須 |
column | text |
| 映射的目標數據表字段 | false |
type | text |
| Hibernate 類(lèi)型 | false |
length | text |
| 所應設數據庫表字段的長(cháng)度 | false |
unsaved-value | text |
| 一個(gè)用來(lái)從新的transient instances中區分transient instances和已存在的persistent狀態(tài)的值 | false |
generator-class | text |
| key generator類(lèi) 可選項: uu id.hex uuid.string increment assigned native identity sequence seqhilo foreign | true |
@hibernate.generator-param (0..*)
指定id generator 參數和值
參數 | 類(lèi)型 | 適用性 | 描述 | 是否必須 |
name | text |
| 參數名稱(chēng) | true |
value | text |
| 參數值 | true |
定義一個(gè)property
參數 | 類(lèi)型 | 適用性 | 描述 | 是否必須 |
column | text |
| 映射的目標數據表字段 | false |
type | text |
| Hibernate 類(lèi)型 | false |
length | text |
| 所應設數據庫表字段的長(cháng)度 | false |
not-null | bool |
| 字段是否可以為null | false |
unique | bool |
| 字段是否unique | false |
insert | bool |
| 字段是否應該出現在SQL INSERT中 | false |
update | bool |
| 字段是否應該出現在SQL UPDATE中 | false |
聲明一個(gè)component
參數 | 類(lèi)型 | 適用性 | 描述 | 是否必須 |
class | text |
| 特定類(lèi)的全名 | false |
Declares a version property
參數 | 類(lèi)型 | 適用性 | 描述 | 是否必須 |
column | text |
| 存放版本號的字段名稱(chēng) | false |
Type | text |
| Hibernate 類(lèi)型 可選項: integer short long timestamp calendar | false |
Declares a timestamp property
參數 | 類(lèi)型 | 適用性 | 描述 | 是否必須 |
column | text |
| 存放timestamp的字段名稱(chēng) | false |
聲明一個(gè)many-to-one 關(guān)系
參數 | 類(lèi)型 | 適用性 | 描述 | 是否必須 |
column | text |
| 映射的目標數據表字段 | false |
class | text |
| 關(guān)系類(lèi)名稱(chēng) | false |
cascade | text |
| 指定從父對象到關(guān)聯(lián)對象有哪些級聯(lián)操作 可選項: 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 |
Declares a one-to-one association
參數 | 類(lèi)型 | 適用性 | 描述 | 是否必須 |
class | text |
| 關(guān)聯(lián)類(lèi) | false |
constrained | bool |
| 是否有外鍵約束 | false |
cascade | text |
| 指定從父對象到關(guān)聯(lián)對象有哪些級聯(lián)操作 可選項: all none save-update delete | false |
outer-join | bool |
| 如果設置了hibernate.use_outer_join,則使這個(gè)關(guān)聯(lián)的outer-join fetching有效 可選項: true false auto | false |
個(gè)性化字段映射
參數 | 類(lèi)型 | 適用性 | 描述 | 是否必須 |
name | text |
| 字段名 | true |
length | text |
| 字段長(cháng)度 | false |
unique | bool |
| 字段是否unique | false |
not-null | bool |
| 字段是否nullable | false |
index | text |
| Index名稱(chēng) | false |
unique-key | text |
| Unique約束的名稱(chēng) | false |
sql-type | text |
| SQL字段類(lèi)型 | false |
Defines a set
參數 | 類(lèi)型 | 適用性 | 描述 | 是否必須 |
inverse | bool |
| 是否轉置的collection | false |
table | text |
| 角色名稱(chēng)的默認值: Collection表的名稱(chēng) (不是用于one-to-many關(guān)聯(lián)) | false |
schema | text |
| 用于覆蓋已聲明schema的表schema名稱(chēng) | false |
lazy | bool |
| 使lazy 初始化有效 | false |
cascade | text |
| 指定從父對象到關(guān)聯(lián)對象有哪些級聯(lián)操作 可選項: all none save-update delete | false |
sort | text |
| 指定一個(gè)排序的collection,該collection應該具有自然的排序順序或者一個(gè)給定的comparator class | false |
order-by | text |
| 指定定義枚舉順序的表字段 | false |
where | text |
| 一個(gè)SQL WHERE 條件 | false |
Defines a bag
參數 | 類(lèi)型 | 適用性 | 描述 | 是否必須 |
inverse | bool |
| 是否轉置的collection | false |
table | text |
| Collection表的名稱(chēng) (不是用于one-to-many關(guān)聯(lián)) | false |
schema | text |
| 用于覆蓋已聲明schema的表schema名稱(chēng) | false |
lazy | bool |
| 使lazy 初始化有效 | false |
cascade | text |
| 指定從父對象到關(guān)聯(lián)對象有哪些級聯(lián)操作 可選項: all none save-update delete | false |
order-by | text |
| 指定定義枚舉順序的表字段 | false |
where | text |
| 一個(gè)SQL WHERE 條件 | false |
Defines a List
參數 | 類(lèi)型 | 適用性 | 描述 | 是否必須 |
table | text |
| Collection表的名稱(chēng) (不是用于one-to-many關(guān)聯(lián)) | false |
schema | text |
| 用于覆蓋已聲明schema的表schema名稱(chēng) | false |
lazy | bool |
| 使lazy 初始化有效 | false |
cascade | text |
| 指定從父對象到關(guān)聯(lián)對象有哪些級聯(lián)操作 可選項: all none save-update delete | false |
where | text |
| 一個(gè)SQL WHERE 條件 | false |
Defines a map
參數 | 類(lèi)型 | 適用性 | 描述 | 是否必須 |
table | text |
| Collection表的名稱(chēng) (不是用于one-to-many關(guān)聯(lián)) | false |
schema | text |
| 用于覆蓋已聲明schema的表schema名稱(chēng) | false |
lazy | bool |
| 使lazy 初始化有效 | false |
cascade | text |
| 指定從父對象到關(guān)聯(lián)對象有哪些級聯(lián)操作 可選項: all save-update delete none | false |
sort | text |
| 指定一個(gè)排序的collection,該collection應該具有自然的排序順序或者一個(gè)給定的comparator class | false |
order-by | text |
| 聲明定義枚舉順序的表的字段 | false |
where | text |
| 一個(gè)SQL WHERE條件 | false |
Defines an array
參數 | 類(lèi)型 | 適用性 | 描述 | 是否必須 |
table | text |
| Collection表的名稱(chēng) (不是用于one-to-many關(guān)聯(lián)) | false |
schema | text |
| 為了覆蓋已聲明schema的表schema的名稱(chēng) | false |
cascade | text |
| 指定從父對象到關(guān)聯(lián)對象有哪些級聯(lián)操作 可選項: all none save-update delete | false |
where | text |
| 一個(gè)SQL WHERE條件 | false |
@hibernate.primitive-array (0..1)
聲明一個(gè)primitive-array
參數 | 類(lèi)型 | 適用性 | 描述 | 是否必須 |
table | text |
| Collection表的名稱(chēng) (不是用于one-to-many關(guān)聯(lián)) | false |
schema | text |
| The name of a table schema to override the schema declared | false |
cascade | text |
| 指定從父對象到關(guān)聯(lián)對象有哪些級聯(lián)操作 可選項: all none save-update delete | false |
聯(lián)系客服