Java Reference
In-Depth Information
Table 7-3.
Continued
Attribute
Values
Default
Description
check
Defines an additional row-level check
constraint, effectively adding this as a
SQL
CHECK( ... )
clause during table
generation (for example,
check="salary < 1000000"
).
discriminator-value
A value used to distinguish between oth-
erwise identical subclasses of a common
type persisted to the same table.
is null
and
is not null
are permissible values.
To distinguish between a
Cat
and a
Dog
derivative of the
Mammal
abstract class,
for example, you might use discrimina-
tor values of
C
and
D
, respectively.
dynamic-insert
true
,
false
false
Indicates whether all columns should
appear in
INSERT
statements. If the
attribute is set to
true
, null columns will
not appear in generated
INSERT
com-
mands. On very wide tables, this may
improve performance; but because
insert statements are cached,
dynamic-insert
can easily produce a
performance hit.
dynamic-update
true
,
false
false
Indicates whether all columns should
appear in
UPDATE
statements. If the
attribute is set to
true
, unchanged
columns will not appear in generated
UPDATE
commands. As with
dynamic-
insert
, this can be tweaked for perform-
ance reasons. You must enable
dynamic-update
if you want to use ver-
sion-based optimistic locking (discussed
in Appendix A).
entity-name
The name of the entity to use in place of
the class name (therefore required if
dynamic mapping is used).
lazy
true
,
false
Used to disable or enable lazy fetching
against the enclosing mapping's default.
mutable
true
,
false
true
Used to flag that a class is immutable
(allowing Hibernate to make some per-
formance optimizations when dealing
with these classes).
name
The fully qualified Java name, or
optionally unqualified if the
<hibernate-
mapping>
element declares a package
attribute, of the class (or interface) that
is to be made persistent.
node
Specifies the name of the XML element
or attribute that should be used by the
XML relational persistence features.
Search WWH ::
Custom Search