To generate EGL code from a database schema, you must first be
connected to the database.
Complete the following steps to generate the EGL code:
- Click File → New → Other → EGL→ EGL
Data Access Application → Next
- Select or type the project name where the generated code is to
be placed.
If the you type a name for a project that does not exist,
a new EGL project will be created. The new project is associated with
the default server for the workbench. If the default server is not
your desired target, you need to create the project using the EGL
New EGL Web Project wizard before transforming the database.
- Select or type the name of the predefined database connections.
- From the list of database tables, select one or more tables to
be transformed.
- Click Create Web pages if you want user
interface code generated that accesses the database. Click Next.
The generated user interface code will consist of JSPs and PageHandlers.
If
you are creating a new project, checking this box will create an EGL
Web Project.
- If you are generating Web pages, complete the following:
- Specify the key fields and those fields that are to be searchable.
Click Next.
- Select the fields to be displayed on the Summary page and click Next.
- Specify the following project creation options:
- Default package name
- This name will be used as a prefix for the package name. For example,
if the user types in myPackage, the generated code will be in packages
named myPackage.data, myPackage.access, and myPackage.handlers.
- Data access method
- Indicates whether we should generate libraries or services for
the access layer.
- Qualify table names with schema
- Indicates that all table references within the generated EGL will
be qualified with the database schema name.
- Use delimited SQL identifiers
- Indicates that all SQL identifiers will be wrapped in double quotes.
This is useful if your tables use identifiers which are SQL reserved
words or contain special characters.
- Create multiple projects
- Indicates that we should put the data definitions, data access
functions, and UI code into separate projects. This will enable an
additional wizard page for specifying the target projects. At least
one of the target projects must be the main project specified in the
first wizard page.
Then click Next
.
- After reviewing the Summary window and verifying your request,
click Finish to start the transformation process.