Simple Join Example

   This example shows a join between three tables. A location belongs to a region which belongs to a division. Many locations can belong to a region, and many regions can belong to a division. For example; the "Boston" location belongs to the "New England" region, which in turn is under the "North America" division.

   The tables are LOCATION, REGION, and DIVISION. The ddl for creating these tables is in table-definitions.sql   The LOCATION table has a foreign key column, REGION_ID, that points to the REGION table. Simularily the REGION table has a foreign key column, DIVISION_ID, that points to the DIVISION table. The region and division are marked as as they are not created and deleted along with the location.

The ddl for creating the table and sequences is in table-definition.sql.
The files division.xml, region.xml, and location.xml contain the details of the tables, and the Java objects we will generate.
The shell command generate.sh invokes the Xalan parser.
It applys the template oracleObjectPersisterTemplate.xsl against the data in the xml files.
The output will be written to Division.java, Region.java, and Location.java.
Use "compile.sh" to compile the source code.
The "Test.java" class demonstrates how to use the Location object.
Use "run.sh" to run the Test class.

Back to: XSL template for JDBC Code generation