Skip Headers

Create a New Project

Previous
Previous
 
Next
Next

In this step, you will create a new Oracle JDeveloper project.

For more information, see "Creating a Project" in Oracle Toplink Developer's Guide.

Show Me...

  1. Select File > New. The New Gallery appears.

  2. In the Categories pane select General > Applications. In the Items pane select Application and click OK. The Create Application dialog appears.

  3. Enter an Application Name (such as Tutorial), select No Template [All Technologies] as the Application Template, and click OK. The Create Project dialog appears.

  4. Enter a Project Name (such as Advanced_Tutorial) and click OK.

JDeveloper adds the project to the Applications Navigator.

New Project

New project.

Add the TopLink Map

Now that you have an empty JDeveloper project, we will add a TopLink map to the project. This will contain the mapping information for the Java classes.

Show Me...

  1. Right-click the Advanced_Tutorial project in the Applications Navigator and select New. The New Gallery appears.

  2. In the Categories pane, select Business Tier > TopLink. In the Items pane select TopLink Object-Relational Map and click OK. The Create Object-Relational Map dialog appears.

  3. Enter a TopLink Map Name (such as tlMap1), select the Database Platform (such as Oracle10g), the Database Connection (that you created previously) and click OK.

The Applications Navigator shows the new TopLink map.

TopLink Map

TopLink map in project.

Add the Database

Now you will add the necessary database tables as offline objects to the JDeveloper project.

For more information, see "Working with Databases" in Oracle Toplink Developer's Guide.

Show Me...

  1. Right-click the Advanced_Tutorial project in the Applications Navigator and select New. The New Gallery appears.

  2. In the Categories pane, select Database Tier > Offline Database Objects. In the Items pane select Offline Database Objects Imported from Database and click OK. The Import Offline Database Objects wizard appears.

  3. Complete this wizard to import the following database tables from your database connection into the JDeveloper project. Use the same database connection that you created earlier (see "Create a Database Connection").

    • ADDRESS

    • EMPLOYEE

    • LPROJECT

    • PHONE

    • PROJ_EMP

    • PROJECT

    • RESPONS

    • SALARY

    • SEQUENCE

Database Tables

Offline database tables in the project.

Define a Sequencing Policy

Sequencing allows TopLink to automatically assign the primary key or ID of an object when the object is inserted. Here, we will tell TopLink to obtain the sequence values from a specific database table.

For more information, see "Understanding Sequencing in Relational Projects" in Oracle Toplink Developer's Guide.

Show Me...

  1. Right-click the tlMap1 TopLink map in the Applications Navigator and select Open. The TopLink Map properties page appears in the Mapping editor. Select the Database Info tab.

  2. In the Sequencing area, select Custom Sequence Table. Use this table to complete the remaining fields.

    Field Description
    Name SEQUENCE
    Sequence Name Field SEQ_NAME
    Sequence Counter Field SEQ_COUNT

Sequencing Information

Sequencng tab.