Java Reference
In-Depth Information
A typical implementation of an idbag mapping is as follows:
<idbag name="idbag" table="nameidbag">
<collection-id column="id" type="int">
<generator class="native"/>
</collection-id>
<key column="fooid"/>
<element type="string" column="name" not-null="true"/>
</idbag>
The map Collection
A map collection allows collection attributes derived from the Map interface to be persisted.
In addition to the common collection mappings, the <map> element offers the inverse ,
order-by , and sort attributes, as shown in Table 7-14.
Table 7-14. The Additional <map> Attributes
Attribute
Values
Default
Description
inverse
true , false
false
Specifies that this entity is the opposite navigable end
of a relationship expressed in another entity's mapping
order-by
Specifies an arbitrary SQL order by clause to constrain
the results returned by the SQL query that populates
the map
sort
unsorted
Specifies the collection class sorting to be used. The
value can be unsorted , natural , or any Comparator
class
The child elements of the <map> element are as follows:
(meta*,
subselect?,
cache?,
synchronize*,
comment?,
key,
(map-key | composite-map-key | map-key-many-to-many |
index | composite-index | index-many-to-many |
index-many-to-any),
(element | one-to-many | many-to-many | composite-element |
many-to-any),
loader?,
sql-insert?,
sql-update?,
sql-delete?,
sql-delete-all?,
filter*)
Search WWH ::




Custom Search