Hibernate collection mapping

1

name : the collection property name

2

table (optional - defaults to property name): the name of the collection table. It is not used for one-to-many associations.

3

schema (optional): the name of a table schema to override the schema declared on the root element

4

lazy (optional - defaults to true ): disables lazy fetching and specifies that the association is always eagerly fetched. It can also be used to enable "extra-lazy" fetching where most operations do not initialize the collection. This is suitable for large collections.

5

inverse (optional - defaults to false ): marks this collection as the "inverse" end of a bidirectional association.

6

cascade (optional - defaults to none ): enables operations to cascade to child entities.

7

sort (optional): specifies a sorted collection with natural sort order or a given comparator class.

8

order-by (optional, JDK1.4 only): specifies a table column or columns that define the iteration order of the Map , Set or bag, together with an optional asc or desc .

9

where (optional): specifies an arbitrary SQL WHERE condition that is used when retrieving or removing the collection. This is useful if the collection needs to contain only a subset of the available data.

10

fetch (optional, defaults to select ): chooses between outer-join fetching, fetching by sequential select, and fetching by sequential subselect.

11

batch-size (optional, defaults to 1 ): specifies a "batch size" for lazily fetching instances of this collection.

12

access (optional - defaults to property ): the strategy Hibernate uses for accessing the collection property value.

13

optimistic-lock (optional - defaults to true ): specifies that changes to the state of the collection results in increments of the owning entity's version. For one-to-many associations you may want to disable this setting.

14

mutable (optional - defaults to true ): a value of false specifies that the elements of the collection never change. This allows for minor performance optimization in some cases.

 

5

unique (optional): enables the DDL generation of a unique constraint for the foreign-key column. This makes the association multiplicity effectively one-to-many.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值