Show TOC Start of Content Area

Procedure documentation Creating the Database Tables  Locate the document in its SAP Library structure

Use

The SAP implementation of the JDO standard uses a relational database as a store for the persistent data. The data in the database is organized in tables. Each persistent capable class is mapped to a table that contains a column for each persistent field of the class.

The data in this example is stored in two database tables:

·        TMP_DEPARTMENT contains data describing the properties of the departments

·        TMP_EMPLOYEE describes the individual employees.

Note

The tables are the same as the ones used in Getting Started with Relational Persistence. If you have already tried the relational persistence example, and have the tables deployed in the database, you can skip this step.

Procedure

...

       1.      Open the Dictionary perspective and create a new Dictionary project, such as GettingStartedPersistenceDic. Confirm the default project language setting (American English).

       2.      Create a table called TMP_EMPLOYEE for the employee data, and a table called TMP_ DEPARTMENT for the department data. For more information, see Creating Tables.

       3.      In the TMP_DEPARTMENT table, add the following columns:

¡        DEPID

¡        NAME

Modify the parameters of the columns as follows:

Column Parameters for TMP_DEPARTMENT

Column Name

Key

Built-In Type

Length

Not Null

Description

DEPID

<selected>

integer

 

<selected>

Department ID

NAME

<deselected>

String

30

<selected>

Department name

 

       4.      In the TMP_EMPLOYEE table, add the following columns:

¡        EMPID

¡        FIRST_NAME

¡        LAST_NAME

¡        SALARY

¡        DEPID

Modify the parameters of the columns as follows:

Column Parameters for TMP_EMPLOYEE

Column Name

Key

Built-In Type

Length

Decimals

Not Null

Description

EMPID

<selected>

integer

 

 

<selected>

Employee ID

FIRST_NAME

<deselected>

string

30

 

<selected>

First name

LAST_NAME

<deselected>

string

30

 

<selected>

Last name

SALARY

<deslected >

decimal

8

2

<selected>

Salary

DEPID

<deselected>

integer

 

 

<selected>

Department ID

 

       5.      Save your data.

Result

You have created the database tables TMP_DEPARTMENT and TMP_EMPLOYEE in the offline Java Dictionary.

Now you have to create the Web project for the application.

 

End of Content Area