JPA tools do not support DB2 Table Aliases

Technote (troubleshooting)


Problem(Abstract)

JPA Tools do not recognize the DB2 Table Aliases as valid table references for entity beans.

Symptom

DB2 Table Aliases are not listed in the Tables section, in the Generate Custom Entities wizard.
Using table annotations such as @Table(name="my_alias") to specify valid DB2 Table Aliases can result in validation errors.


Cause

JPA Tools does not support DB2 Table Aliases.

Refer to the 'Generation of JPA entities from DB2 alias' enhancement in the related URL section

Diagnosing the problem

NOTE: You require a connection to a DB2 instance containing at least one table alias.

1) Start Rational Application Developer
2) Open (or create a new) JPA project, with the database connection set to the DB2 instance.
3) Right click on the JPA project > JPA Tools > JPA Entities from Tables...
4) Click Next
5) Ensure the connection is set to to the DB2 instance and select the schema containing the table alias.

The alias is not displayed in the Tables section.


Resolving the problem

There are two alternatives to work around the problem with the reference(s) that are not resolved:

  • Use the table name(s) instead of the table alias(es).
  • Turn off JPA validation:
1. Open Preferences dialog (Windows > Preferences)
2. Go to the Validation page
3. Deselect the Build checkbox for JPA Validator:

Related information

Generation of JPA entities from DB2 alias

Rate this page:

(0 users)Average rating

Document information


More support for:

Rational Application Developer for WebSphere Software
Database Tooling

Software version:

8.0, 8.0.1, 8.0.2, 8.0.3, 8.0.4, 8.0.4.1, 8.0.4.2, 8.5, 8.5.1

Operating system(s):

Linux, Mac OS X, Windows

Reference #:

1634270

Modified date:

2013-05-07

Translate my page

Machine Translation

Content navigation