Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Creating a Relational Project (ELUG)

Revision as of 17:16, 29 November 2007 by Rick.sapir.oracle.com (Talk | contribs) (How to Export Project Java Source Using Workbench)

This section describes the various components that you must configure in order to create a relational project.

For information on how to create more than one type of EclipseLink projects, see Creating a Project.


Introduction to the Relational Project Creation

You can create a project using the Workbench or Java code.

We recommend using the Workbench to create projects and generate deployment XML or Java source versions of the project for use at run time. For more information on how to create a project using Workbench, see How to Create a Project Using the Workbench. For information on how to create a project using Java, see How to Create a Project Using Java.

You can use EclipseLink to create a relational project, if any of the following conditions are met:


For more information, see Introduction to Relational Projects.


Creating a Project from an Existing Object and Data Model

If you have both an existing object model (Java classes for your domain objects) and data model (such as an existing database schema), use this procedure to create your EclipseLink project.


How to Create a Project from an Existing Object and Data Model Using Workbench

  1. Create the project (see How to Create a Project Using the Workbench).
  2. Configure the project classpath (see Configuring Project Classpath).
  3. Import classes (see How to Import and Update Classes).
  4. Import database tables (see Importing Tables from a Database).
  5. Automatically create mappings (see How to Create Mappings Automatically During Development Using Workbench).
  6. Configure project options (see Chapter 113, "Configuring a Project).


Creating a Project from an Existing Object Model

If you have an existing object model (Java classes for your domain objects), but you do not have a corresponding data model, use this procedure to create your EclipseLink project and automatically generate the corresponding data model.


How to Create a Project from an Existing Object Model Using Workbench

  1. Create the project (see How to Create a Project Using the Workbench).
  2. Configure the project classpath (see Configuring Project Classpath).
  3. Import classes (see How to Import and Update Classes).
  4. Generate database tables. For more information, see the following:
  5. Configure project options (see Configuring a Project).


Creating a Project from an Existing Data Model

If you have an existing data model (such as a database schema), but you do not have a corresponding data model (Java classes for domain objects), use this procedure to create your EclipseLink project and automatically generate the corresponding object model.


How to Create a Project from an Existing Data Model Using Workbench

  1. Create the project (see How to Create a Project Using the Workbench).
  2. Import database tables (see Importing Tables from a Database).
  3. Generate classes. For more information, see either of the following:
  4. Configure project options (see Configuring a Project).


Exporting Project Information

Workbench generates and exports the following project information:


How to Export Project Java Source Using Workbench

For relational projects only, you can convert the project to Java source code. Generally, the generated code executes faster and deploys easier than XML files. See Generating Java Code for Descriptors to export the model source for a specific descriptor in a project. To convert your relational project to Java source, use this procedure:

  1. Right-click the project in the Navigator and choose Export > Project Java Source from the context menu.Export to Java Source button
    You can also choose Workbench > Export > Export Java Source or Selected > Export > Project Java Source from the menu. If you have not defined deployment and source code generation defaults (see Configuring a Project) Workbench prompts for a project class name and directory.


Note If your Workbench project uses the UTF-8 character set, you must use a compatible JDK when compiling the exported Java source. If your project contains errors, the project.xml file may not be valid. See for information on each reported error.


How to Export Table Creator Files Using Workbench

For relational projects only, you can create Java source code to generate database tables defined in the project using this procedure:

  1. Right-click the project in the Navigator and choose Export > Table Creator Java Source from the context menu.You can also choose Workbench > Export > Table Creator Java Source or Selected > Export > Table Creator Java Source from the menu.

If you have not defined deployment and source code generation defaults (see Configuring a Project) Workbench prompts for a class name and root directory.




Copyright Statement

Copyright © Eclipse Foundation, Inc. All Rights Reserved.