Java Reference
In-Depth Information
Named queries are explained in detail in the next subsection.
In the next screen in the wizard, we can select how associated entities will be
fetched (eagerly or lazily). The default behavior is to fetch
one-to-one
and
many-to-one
relationships eagerly, and
one-to-many
and
many-to-many
relationships lazily.
Additionally, we can select what collection type to use for the many side of a
one-to-many
or
many-to-many
relationship. The default value is
java.util.
Collection
, and other valid values are
java.util.List
and
java.util.Set
.
Checking the
Fully Qualified Database Table Names
checkbox results in the catalog
and schema elements of the table being mapped to the
@Table
annotation for each
generated entity.
Checking the
Attributes for Regenerating Tables
checkbox results in the generated
@Column
annotations having attributes such as
length
, which specifies the maximum
length allowed in the column;
nullable
, which specifies whether
null
values are
allowed in the column; and
precision
and
scale
, which specify the precision
and scale of decimal values, respectively. Checking this checkbox also adds the
uniqueConstraints
attribute to the generated
@Table
annotation to specify any
unique constraints that apply to the table, if necessary.