Skip Headers
Dali Java Persistence Tools User Guide
Release 3.2
Release 3.2
  PDF
PDF
Go To Table Of Contents
Contents
Go To Index
Index

Previous
Reference
 
Next
Property pages
 

Wizards

This section includes information on the following wizards:

Generate Entities from Tables wizard

Use the Generate Custom Entities Wizard to create JPA entities from your database tables.

The wizard consists of the following pages:

Select Tables

Use the Select Tables dialog to specify the database connection and tables from which to create entities.

Property Description

Connection

Select a database connection or click Add Connection to create a new connection.

Schema

Select the database schema from which to select tables.

Tables

Select the tables from which to create Java persistent entities. The tables shown are determined by the database connection and schema selections.

Update class list in persistence.xml

Specify if Dali should update the persistence.xml file to include the generated classes.


Related tasks

Related reference

Table Associations

Use this page to create or edit the association between the database table and entity.

Property Description

Table associations

Select an association to modify or click New Association to create a new table association with the Create New Association wizard wizard.

Generate this association

Specify if Dali should create the selected association. If enabled, you can specify the Cardinality and Table join for the table association.

Generate a reference to <ROW> in <TABLE>

Specify if the entity should contain a reference to the specified table.

If enabled, you can also enter the Property name and select the Cascade method (all, persist, merge, remove, or refresh) for the reference.


Related tasks

Related reference

Customize Default Entity Generation

Use this page to specify the default information Dali will use when generating the entities from the database tables. You will be able to override this information for specific entities.

Property Description

Mapping defaults

Use these options to define the table mapping information for the entity.

Key generator

Select the generator used for this mapping.

Sequence name

Enter a name for the sequence.

You can use $table and $pk as variables in the name. These will be replaced by the table name and primary key column name (respectively) when Dali generates a table mapping.

Entity access

Specify the default entity access method: Field (default) or Property.

Associations fetch

Specify the default fetch mode for associations: Default, as defined by the application (default), or Lazy.

Collection properties type

Specify if the collection properties are a Set or List.

Always generate optional JPA annotations and DDL parameters

Specify if Dali should include this information in the entity.

Domain Java class

Use these options to define the Source folder and class information (Package, Superclass, and Interfaces) for the entity.


Related tasks

Related reference

Customize Individual Entities

Use this page to customize each generated entity. Select an item in the Table and columns area, then complete the following fields for each item.

Property Description

Mapping defaults

Use these options to define the table mapping information for the entity.

Class name

Name of the entity class

Key generator

Select the generator used for this mapping.

Sequence name

Enter a name for the sequence.

You can use $table and $pk as variables in the name. These will be replaced by the table name and primary key column name (respectively) when Dali generates a table mapping.

Entity access

Specify the default entity access method: Field (default) or Property.

Domain Java Class

Use these options to define the class information (Superclass and Interfaces) for the entity.

Generate this property

Enable this option to generate the following properties for the selected column.

Column mapping


Property name

The name of the property derived from the column

Mapping type

The attribute type

Mapping kind

The type of mapping for the attribute

Column is updatable

Specify if the column is included in SQL UPDATE statements.

Column is insertable

Specify if the column is included in SQL INSERT statements.

Domain Java Class

Use these options to define the getter and setter scope for the entity.


Related tasks

Related reference

Generate Dynamic Entities from Tables wizard

Use the Generate Dynamic Custom Entities wizard to create dynamic EclipseLink JPA entities from your database tables.

The wizard consists of the following pages:

Select Tables

Use the Select Tables dialog to specify the database connection and tables from which to create entities.

Property Description

Connection

Select a database connection or click Add Connection to create a new connection.

Schema

Select the database schema from which to select tables.

Tables

Select the tables from which to create Java persistent entities. The tables shown are determined by the database connection and schema selections.

Update class list in persistence.xml

Specify if Dali should update the persistence.xml file to include the generated classes.


Related tasks

Related reference

Table Associations

Use this page to create or edit the association between the database table and entity.

Property Description

Table associations

Select an association to modify or click New Association to create a new table association with the Create New Association wizard wizard.

Generate this association

Specify if Dali should create the selected association. If enabled, you can specify the Cardinality and Table join for the table association.

Generate a reference to <ROW> in <TABLE>

Specify if the entity should contain a reference to the specified table.

If enabled, you can also enter the Property name and select the Cascade method (all, persist, merge, remove, or refresh) for the reference.


Related tasks

Related reference

Customize Default Entity Generation

Use this page to specify the default information Dali will use when generating the entities from the database tables. You will be able to override this information for specific entities.

Property Description Default

XML Mapping File

The name and location of the mapping file.

META-INF/eclipselink-orm.xml

Dynamic Class Defaults



Package

Default package name for dynamic classes

model

Mapping defaults



Key generator

Default generation strategy for primary keys:

  • Auto

  • Identity

  • Sequence

  • Table

  • None

None

Sequence name

When using a Key generator, specify its name.

Note: You can use the variables $table and $pk in the Sequence name. Dali will replace them with the table name and primary key column name, respectively, when generating a mapping table.


Associations fetch

Specify the default fetch strategy for generated entities:

  • Default

  • Eager

  • Lazy

Default

Collection properties type

Specify the default collection type, for generated entities:

  • java.util.Set

  • java.util.List

java.util.List


Related tasks

Related reference

Customize Individual Entities

Use this page to customize each generated entity. Select an item in the Table and columns area, then complete the following fields for each item.

Property Description

Mapping defaults

Use these options to define the table mapping information for the entity.

Class name


Key generator

Select the generator used for this mapping.

Sequence name

Enter a name for the sequence.

You can use $table and $pk as variables in the name. These will be replaced by the table name and primary key column name (respectively) when Dali generates a table mapping.

Entity access

Specify the default entity access method: Field (default) or Property.

Domain Java Class

Use these options to define the class information (Superclass and Interfaces) for the entity.


Related tasks

Related reference

Create JPA Entity wizard

The Create JPA wizard enables you to quickly add an entity and also add persistence fields to that entity. In addition, this wizard adds the accessor methods (getter and setter) in the class file. The wizard consists of the following pages:

Entity Class page

This table lists the properties of the Entity Class page of the Create JPA Entity wizard.

Property Description Default

Project

The name of the JPA project.


Source Folder

The location of the JPA project's src folder.

src

Java Package

The name of the class package.


Class name

The name of the Java class.


Superclass

Select the superclass.


Inheritance

Because the wizard creates a Java class with an @Entity notation, the Entity option is selected by default.

Select Mapped Superclass if you defined a superclass.

To add an @Inheritance notation to the entity, select Inheritance and then select one of the inheritance mapping strategies (described in JSR 220):

  • SINGLE_TABLE -- All classes in a hierarchy as mapped to a single table. This annotation is without an attribute for the inheritance strategy.

  • TABLE_PER_CLASS -- Each class is mapped to a separate table.

  • JOINED -- The root of the class hierarchy is represented by a single table. Each subclass is represented by a separate table that contains those fields that are specific to the subclass (not inherited from its superclass), as well as the column(s) that represent its primary key. The primary key column(s) of the subclass table serves as a foreign key to the primary key of the superclass table.

Entity

XML Entity Mappings

Select Add to entity mappings in XML to create XML mappings in orm.xml, rather than annotations.

Use the Mapping file field to specify the file to use. By default, mappings are stored in the META-INF/orm.xml file.



Related tasks

Related reference

Entity Properties page

This table lists the properties of the Entity Properties page of the Create JPA Entity wizard.

Property Description Default

Entity name

The name of the entity. By default, this value is the same as the one entered as the class name. If the entity name differs from the class name, then the entity name is added as an attribute. For example: @Entity(name="EntityName").

Determined by server.

Table name

Select Use default to match the name of the mapped table name to the entity name. Otherwise, clear the Use default option and enter the name in the Table Name field. These options result in the addition of the @Table option to the Java class file.

Use default.

Entity fields

Click the Add button to add persistence fields using the Entity Fields dialog. This dialog enable you to build a field by entering a field name and selecting among persistence types. The Key option enables you to mark a field as a primary key. The dialog's Browse function enables you to add other persistence types described in the JPA specification. The Edit button enables you to change the name or type set for a persistent field.


Access type

Select whether the entity's access to instance variables is field-based or property-based, as defined in the JPA specification.

  • Field – Instance variables are accessed directly. All non-transient instance variables are persistent.

  • Property – Persistent state accessed through the property accessor methods. The property accessor methods must be public or private.

Field


Related tasks

Related reference

Create ORM Mapping File wizard

The New Mapping File wizard enables you to add an orm.xml file to a JPA project if no object map exists at the location specified. For example, if you cleared the Create orm.xml option on the JPA Facet page, you can later add the orm.xml file to the src file of the project using this wizard.

The Create ORM Mapping File wizard consists of the following pages:

Mapping File Location

Use this page of the Create ORM Mapping File wizard to specify the location of the ORM mapping file.

Property Description Default

Project

The name of the JPA project.

Selected.

Source folder

The location of the project's src folder. If needed, click Browse to point the wizard to the src file's location.

Selected.

File Path

The location for the new orm.xml file.

Selected.

File name

Name of the OR mapping file.

orm.xml


Related tasks

Related reference

Mapping File Options

Use this page of the Create ORM Mapping File wizard to specify additional options for the ORM mapping file.

Property Description Default

Default Access

Select whether the access to the entity is field-based or property-based, as defined in JPA specification.

  • None – No access type specified.

  • Property-based – Persistent state accessed through the property accessor methods. The property accessor methods must be public or private.

  • Field-based – Instance variables are accessed directly. All non-transient instance variables are persistent.

None

Add to persistence unit

Designates the persistence unit for this object map file.

Current project's default persistence unit


Related tasks

Related reference

Create New JPA Project wizard

The Create New JPA Project wizard allows you to create a new Java project using JPA. The wizard consists of the following pages:

New JPA Project page

This table lists the properties available on the New JPA Project page of the Create New JPA Project wizard.

Property Description Default

Project name

Name of the Eclipse JPA project.


Project location

Location of the workspace in which to save the project.

Unselect the Use default location option and click Browse to select a new location.

Current workspace

Target runtime

Select a pre-defined target for the project.

Click New Runtime to create a new environment with the New Server Runtime wizard.

<None>

JPA Version

Select the Java Persistence API version for the project.

2.0

Configurations

Select a project configuration with pre-defined facets.

Select Modify to manually select the facets for this project.


EAR membership

Specify if this project should be included in an EAR file for deployment.

Select the EAR Project Name, or click New Project to create a new EAR project.


Working sets

Specify if this project should be included in an existing working set. The drop down field shows a list of previous selected working sets.

Select Add project to working sets, then select a Working set in which to add this project.



Related tasks

Related reference

Java Page

This table lists the properties available on the Java page of the Create New JPA Project wizard.

Property Description Default

Source folders on build path

Click Add Folder to select an existing Java source folder to add to this project.

src

Default output folder

Specify the location of the .class files.

build\classes


Related tasks

Related reference

JPA Facet page

This table lists the properties available on the JPA Facet page of the Create New JPA Project wizard.

Property Description Default

Platform

Vendor-specific JPA implementation.

Generic

JPA Implementation

Select a specific JPA library configuration.

Click Manage libraries to create or update a user library.

Click Download libraries to download a specific library configuration.

Depending on your JPA implementation (for example, Generic or EclipseLink), different options may be available when working with JPA projects


Type

Select User Library to select from the available user-defined or downloaded libraries.

If you select Disable, you must manually include the JPA implementation library on the project classpath.

User Library

Include libraries with this application

Specify if the selected libraries are included when deploying the application.

Selected

Connection

Select the database connection to use with the project. Dali requires an active database connection to use and validate the persistent entities and mappings.

Click Add connection to create a new database connection.


Add driver library to build path

Specify if the connection driver libraries are included when deploying the application.


Override default schema from connection

Select a schema other than the default one that is derived from the connection information. Use this option if the default schema cannot be used. For example, use this option when the deployment login differs from the design-time login.

The value calculated by Dali.

Persistent class management

Specify if Dali will discover annotated classes automatically, or if the annotated classes must be listed in the persistence.xml file.

Note: To insure application portability, you should explicitly list the managed persistence classes that are included in the persistence unit.

Determined by server.

Create mapping file (orm.xml)

Specify if Dali should create a default orm.xml file for your entity mappings and persistence unit defaults.

Selected


Related tasks

Related reference

Create New JAXB Project wizard

The Create New JAXB Project wizard allows you to create a new Java project using JAXB. The wizard consists of the following pages:

New JAXB Project page

This table lists the properties available on the New JPA Project page of the Create New JPA Project wizard.

Property Description Default

Project name

Name of the Eclipse JPA project.


Project location

Location of the workspace in which to save the project.

Unselect the Use default location option and click Browse to select a new location.

Current workspace

Target runtime

Select a pre-defined target for the project.

Click New Runtime to create a new environment with the New Server Runtime wizard.

<None>

JAXB Version

Select the Java Architecture for XML Binding (JAXB) version for the project.

2.2

Configurations

Select a project configuration with pre-defined facets.

Select Modify to manually select the facets for this project.


Working sets

Specify if this project should be included in an existing working set. The drop down field shows a list of previous selected working sets.

Select Add project to working sets, then select a Working set in which to add this project.



Related tasks

Related reference

Java Page

This table lists the properties available on the Java page of the Create New JAXB Project wizard.

Property Description Default

Source folders on build path

Click Add Folder to select an existing Java source folder to add to this project.

src

Default output folder

Specify the location of the .class files.

build\classes


Related tasks

Related reference

JAXB Facet page

This table lists the properties available on the JPA Facet page of the Create New JAXB Project wizard.

Property Description Default

Platform

Vendor-specific JPA implementation.

Generic

JAXB Implementation

Select a specific JPA library configuration.

Click Manage libraries to create or update a user library.

Click Download libraries to download a specific library configuration.

Depending on your JPA implementation (for example, Generic or EclipseLink), different options may be available when working with JPA projects


Type

Select User Library to select from the available user-defined or downloaded libraries.

If you select Disable, you must manually include the JPA implementation library on the project classpath.

User Library

Include libraries with this application

Specify if the selected libraries are included when deploying the application.

Selected


Related tasks

Related reference

New Database Web services from Builder XML wizard

The New Database Web services from Builder XML wizard allows you to add database web services (DBWS) to an existing dynamic web services project, from an XML source. The wizard consists of the following pages:

Web Dynamic page

Use this page to select the dynamic web services project in which to add the Database Web Services.

Related tasks

Related reference

Select Builder XML File page

Use this page to select the XML files from which to generate the database web services.

Click Import to use the Import Wizard to import an existing XML file.

Related tasks

Related reference

Driver Files page

Use this page to add JAR files that contain driver information.

Related tasks

Related reference

Generate Tables from Entities wizard

Use the Generate Tables from Entities Wizard to quickly create DDL scripts from your persistent entities. Dali automatically creates the necessary primary and foreign keys, based on the entity mappings.


WARNING:

Generating tables will DROP any existing tables and CREATE new tables, based on the entities in your project.


The Generate Tables from Entities wizard consists of the Schema Generation page.

Schema Generation

This table lists the properties of the Schema Generation page of the Generate Tables from Entities wizard.

Property Description Default

Generation Output Mode

Specify how Dali should generate the DDL:

  • Database – DDL will be generated and written to the database only.

  • SQL-script – DDL will be generated and written to a file only.

  • Both – DDL will be generated and written to both the database and a file.

Database


Related tasks

Related reference

Create New Association wizard

Use the Create New Association wizard to specify association tables when generating an entity.

The wizard consists of the following pages:

Association Tables

Use this page to specify the association tables for an entity.

Property Description

Association kind

Specify if the association is Simple (1:M) or Many to Many (M:M).

Association tables

Click Table Selection, then select the two tables to associate.

When creating a Many to Many association, you can select a Join Table for the association.


Related tasks

Related reference

Join Columns

Use this dialog to specify the join columns of an association table.

Click Add to specify the join columns between the two tables.

Related tasks

Related reference

Association Cardinality

Use this dialog to specify cardinality of an association table. Depending on the Association Kind and Join Columns that you selected previously, some associations may not be available.

  • Many to one

  • One to many

  • One to one

  • Many to many

Related tasks

Related reference