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

Generating tables from entities
Modifying persistent project properties

Generating dynamic entities from tables

When using EclipseLink JPA, you can create dynamic entities from your database tables. This dynamic persistence provides access to a relational database with all the benefits of JPA without coding or maintaining Java classes.

Dali dynamically creates the classes at runtime, as needed.

To generate dynamic entities:

  1. Right-click the JPA project in the Project Explorer and select JPA Tools > Generate Dynamic Entities from Tables.

    JPA Tools > Generate Dynamic Entities from Tables

    The Select Tables page of the Generate Dynamic Entities from Tables wizard appears.

    Figure 3-68 Select Tables

  2. On the Select Tables page, select the tables from which to generate the entities and click Next.

    The Table Associations page appears.

    Figure 3-69 Table Associations

  3. On the Table Associations page, specify which table associations should be generated. Use the Create New Association wizard to create additional relationships.

    Click Next. The Customize Default Entity Generation page appears.

    Figure 3-70 Customize Defaults

  4. On the Customize Default Entity Generation page, specify the default information to use when generating the entities, and click Next.

    The Customize Individual Entities page appears.

    Figure 3-71 Customize Individual Entities

  5. Use the Customize Individual Entities page to customize specific generated entities.

  6. Click Finish to complete the wizard and generate the entities.

Dali generates the dynamic entities, using the VIRTUAL access type, as shown in Example 3-4.

Example 3-4 Sample eclipselink-orm.xml File with Dynamic Entities

<?xml version="1.0" encoding="UTF-8"?>
<entity-mappings version="2.4" xmlns="" xmlns:xsi="" xsi:schemaLocation="">
    <entity class="quickstart.demo.model.Inventory" access="VIRTUAL">
            <id name="itemSku" attribute-type="long">

    <entity ...">