Java Reference
In-Depth Information
Table 7-6. The <property> Attributes
Attribute
Values
Default
Description
access
Defines how the properties should be accessed:
through field (directly), through property (calling
the get/set methods), or through the name of a
PropertyAccessor class to be used. The value from
the <class> element or <hibernate-mapping> element
will be inherited if this is not specified.
column
The column in which the property will be main-
tained. If omitted, this will default to the name of the
attribute; or it can be specified with nested <column>
elements (see Listing 7-2).
formula
An arbitrary SQL query representing a computed
property (i.e., one that is calculated dynamically,
rather than represented in a column).
index
The name of an index to be maintained for the
column.
insert
true , false
true
Specifies whether creation of an instance of the class
should result in the column associated with this
attribute being included in insert statements.
lazy
true , false
false
Defines whether lazy instantiation is used by default
for this column.
length
The column length to be used.
name
The (mandatory) name of the attribute. This should
start with a lowercase letter.
node
Specifies the name of the XML element or attribute
that should be used by the XML relational persist-
ence features.
not-null
true , false
false
Specifies whether the column is permitted to contain
null values.
optimistic-lock
true , false
true
Determines whether optimistic locking should be
used when the attribute has been updated.
precision
Allows the precision (the number of digits) to be
specified for numeric data.
scale
Allows the scale (the number of digits to the right of
the decimal point) to be specified for numeric data.
type
The Hibernate type of the column.
unique
true , false
false
Indicates whether duplicate values are permitted for
this column/attribute.
unique-key
Groups the columns together by this attribute value.
Represents columns across which a unique key con-
straint should be generated (not yet supported in the
schema generation).
update
true , false
true
Specifies whether changes to this attribute in
instances of the class should result in the column
associated with this attribute being included in
update statements.
Search WWH ::




Custom Search