Java Reference
In-Depth Information
Table 7-9. Continued
Attribute
Values
Default
Description
insert
true , false
true
Indicates whether the field can be persisted.
When set to false , this prevents inserts if the
field has already been mapped as part of a
composite identifier or some other attribute.
lazy
false , proxy ,
Overrides the entity-loading mode.
noproxy
name
The (mandatory) name of the attribute. This
should start with a lowercase letter.
node
Specifies the name of the XML element or attrib-
ute that should be used by the XML relational
persistence features.
not-found
exception ,
exception
The behavior to exhibit if the related entity does
ignore
not exist (either throw an exception or ignore the
problem).
not-null
true , false
false
Specifies whether a not-null constraint should
be applied to this column.
optimistic-lock
true , false
true
Specifies whether optimistic locking should be
used.
outer-join
true , false ,
Specifies whether an outer join should be used.
auto
property-ref
Specifies the column in the target entity's table
that the foreign key references. If the referenced
table's foreign key does not reference the pri-
mary key of the “many” end of the relationship,
then property-ref can be used to specify the col-
umn that it references. This should only be the
case for legacy designs—when creating a new
schema, your foreign keys should always refer-
ence the primary key of the related table.
unique
true , false
false
Specifies whether a unique constraint should be
applied to the column.
unique-key
Groups the columns together by this attribute
value. Represents columns across which a
unique key constraint should be generated (not
yet supported in the schema generation).
update
true , false
true
When set to false , prevents updates if the field
has already been mapped elsewhere.
If a unique constraint is specified on a many-to-one relationship, it is effectively converted
into a one-to-one relationship. This approach is preferred over creating a one-to-one association,
both because it results in a simpler mapping and because it requires less intrusive changes to the
database should it become desirable to relax the one-to-one association into a many-to-one.
This element has a small number of optional daughter elements—the <column> element
will be required when a composite key has to be specified:
(meta*, (column | formula)*)
Search WWH ::




Custom Search