New Entity Classes from Database Wizard: Mapping Options

In this page of the wizard you can set options for configuring generated annotation elements.

Element Description

Association Fetch

Select the fetch element to add to the relationship annotations. You can select default, eager or lazy. When default is selected (default is selected by default), no fetch element is added to the relationship annotations.

Collection Type

Select the collection type for OneToMany and ManyToMany CMR fields.

You can select java.util.Collection, java.util.List or java.util.Set. java.util.Collection is selected by default.

Fully Qualified Database Table Names

When selected, catalog and schema elements are added to the @Table annotation. This option is deselected by default.

Attributes for Regenerating Database Tables

When selected, nullable (when it is false), length (for String type), precision and scale (for decimal type) are added to the @Column annotation.

Unique constraints are also added to the @Table annotation when selected. This option is deselected by default..

Use Column Names in Relationships

When selected, when a table references a foreign key, the field name is generated according to the name of the column in the table. For example, if the table customer has a column named zip that is mapped to a column named zip_code in table micromarket, the generated field name will be zip. This option is selected by default.

When this option is deselected, the field name is generated according to the name of the table that contains the foreign key. In the example above, the generated field name will be microMarket.

Use Defaults if Possible

When selected, only annotations that modify the default behavior or attributes will be generated.

Selecting this option can reduce the number of unnecessary annotations that are generated. This option is deselected by default.

Generate Fields for Unresolved Relationships

When selected, basic generic fields are generated for the fields in a relationship that reference fields or entities that are missing or cannot be resolved. The basic fields that are generated might not accurately represent the columns in the tables because of the missing data.

When deselected, fields in a relationship are not generated if any of the fields or entities in the relationship are missing. This option is deselected by default.



Related Topics

Developing Applications with NetBeans IDE,

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.