The pureQuery nested
beans example uses tables from the DB2® sample
database GSDB.
The example returns information from the example
SQL query.
The information is from the EMPLOYEE, EMPLOYEE_HISTORY,
and ORGANIZATION tables from the GOSALESHR schema. The query returns
the following information from the tables:
- The employee ID, given name, and family name from the EMPLOYEE
table.
- The current department ID for the employee from EMPLOYEE_HISTORY
table.
- The department ID and the name of the department ORGANIZATION
table.
The following tables contain column information for the
database tables used in the pureQuery nested
bean example. For information about the GSDB database, see GSDB sample database.
Table 1. EMPLOYEE
table columns. Column name |
Data type |
Length |
Column can contain NULLs |
EMPLOYEE_CODE |
INTEGER |
4 |
No |
FIRST_NAME |
VARCHAR |
75 |
No |
FIRST_NAME_MB |
VARCHAR |
75 |
Yes |
LAST_NAME |
VARCHAR |
90 |
No |
LAST_NAME_MB |
VARCHAR |
90 |
Yes |
DATE_HIRED |
TIMESTAMP |
10 |
Yes |
TERMINATION_DATE |
TIMESTAMP |
10 |
Yes |
TERMINATION_CODE |
INTEGER |
4 |
Yes |
BIRTH_DATE |
TIMESTAMP |
10 |
Yes |
GENDER_CODE |
SMALLINT |
2 |
No |
WORK_PHONE |
VARCHAR |
90 |
Yes |
EXTENSION |
VARCHAR |
30 |
Yes |
FAX |
VARCHAR |
60 |
Yes |
EMAIL |
VARCHAR |
120 |
Yes |
Table 2. EMPLOYEE_HISTORY table columns. Column name |
Data type |
Length |
Column can contain NULLs |
EMPLOYEE_HISTORY_CODE |
INTEGER |
4 |
No |
EMPLOYEE_HISTORY_PARENT |
INTEGER |
4 |
Yes |
EMPLOYEE_CODE |
INTEGER |
4 |
No |
RECORD_START_DATE |
TIMESTAMP |
10 |
No |
RECORD_END_DATE |
TIMESTAMP |
10 |
Yes |
POSITION_CODE |
INTEGER |
4 |
Yes |
POSITION_START_DATE |
TIMESTAMP |
10 |
Yes |
MANAGER_CODE |
INTEGER |
4 |
Yes |
MANAGER |
VARCHAR |
168 |
Yes |
MANAGER_MB |
VARCHAR |
168 |
Yes |
BRANCH_CODE |
INTEGER |
4 |
Yes |
ORGANIZATION_CODE |
VARCHAR |
30 |
Yes |
Table 3. ORGANIZATION table columns. Column Name |
Data type |
Length |
Column Can Contain NULLs |
ORGANIZATION_CODE |
VARCHAR |
30 |
No |
ORGANIZATION_PARENT |
VARCHAR |
30 |
Yes |
ORGANIZATION_NAME_EN |
VARCHAR |
180 |
Yes |
ORGANIZATION_NAME_DE |
VARCHAR |
180 |
Yes |
ORGANIZATION_NAME_FR |
VARCHAR |
180 |
Yes |
ORGANIZATION_NAME_JA |
VARCHAR |
180 |
Yes |
ORGANIZATION_NAME_CS |
VARCHAR |
180 |
Yes |
ORGANIZATION_NAME_DA |
VARCHAR |
180 |
Yes |
ORGANIZATION_NAME_EL |
VARCHAR |
180 |
Yes |
ORGANIZATION_NAME_ES |
VARCHAR |
180 |
Yes |
ORGANIZATION_NAME_FI |
VARCHAR |
180 |
Yes |
ORGANIZATION_NAME_HU |
VARCHAR |
180 |
Yes |
ORGANIZATION_NAME_ID |
VARCHAR |
180 |
Yes |
ORGANIZATION_NAME_IT |
VARCHAR |
180 |
Yes |
ORGANIZATION_NAME_KO |
VARCHAR |
180 |
Yes |
ORGANIZATION_NAME_MS |
VARCHAR |
180 |
Yes |
ORGANIZATION_NAME_NL |
VARCHAR |
180 |
Yes |
ORGANIZATION_NAME_NO |
VARCHAR |
180 |
Yes |
ORGANIZATION_NAME_PL |
VARCHAR |
180 |
Yes |
ORGANIZATION_NAME_PT |
VARCHAR |
180 |
Yes |
ORGANIZATION_NAME_RU |
VARCHAR |
180 |
Yes |
ORGANIZATION_NAME_SC |
VARCHAR |
180 |
Yes |
ORGANIZATION_NAME_SV |
VARCHAR |
180 |
Yes |
ORGANIZATION_NAME_TC |
VARCHAR |
180 |
Yes |
ORGANIZATION_NAME_TH |
VARCHAR |
180 |
Yes |