Skip Headers
Oracle TopLink Developer's Guide
10g Release 3 (10.1.3)
B13593-01
  Go To Documentation Library
Home
Go To Product List
Solution Area
Go To Table Of Contents
Contents
Go To Index
Index

Previous
Previous
Next
Next
 

Relational Projects

Use a relational project for transactional persistence of Java objects to a conventional relational database (see "Building Relational Projects for a Relational Database") or to an object-relational database that supports data types specialized for object storage (see "Building Relational Projects for an Object-Relational Database"), both accessed using JDBC.


Note:

If you are using TopLink Workbench, you must add your JDBC driver to the TopLink Workbench classpath. If you are using TopLink Workbench and direct to XML type mappings (see "Direct to XMLType Mapping"), you must add the Oracle Database xdb.jar file to the TopLink Workbench classpath.

For more information, see "Configuring the TopLink Workbench Environment".


In a relational project, you can make full use of TopLink queries and expressions (see "Understanding TopLink Queries").

Building Relational Projects for a Relational Database

TopLink Workbench provides complete support for creating relational projects that map Java objects to a conventional relational database accessed using JDBC.

Table 20-3 describes the components of a relational project for a relational database.

Table 20-3 Components of a Relational Project for a Relational Database

Component Supported Types

Data Source

For more information, see the following:

Descriptors

For more information, see "Relational Descriptors".

Mappings

For more information, see the following:


Building Relational Projects for an Object-Relational Database

TopLink Workbench does not currently support relational projects for an object-relational database. You must create such a relational project in Java.

Using Java, you can create a relational project for transactional persistence of Java objects to an object-relational database that supports data types specialized for object storage (such as Oracle Database) accessed using JDBC.

When using TopLink to build a relational project for an object-relational database, consider the following:

  • You must create a Java class and a TopLink ObjectRelationalDescriptor for each structured type (Struct/object-type)

  • TopLink supports only arrays (Varrays) of basic types or arrays on structured types (Struct/object-type).

    TopLink does not support arrays of Refs or arrays of nested tables.

  • TopLink supports only nested tables of Refs.

    TopLink does not support nested tables of basic types, structured types, or array types.

The general development process for building a relational project for an object-relational database is as follows:

  1. Define structured object-types in the database.

  2. Define tables of the structured object-types in the database.

  3. Define the Java classes that will map to the structured object-types.

  4. Create a relational project (see "Creating a Project").

  5. Create an object-relational descriptor for each Java class (see "Creating an Object-Relational Descriptor").

  6. Create object-relational mappings from each persistent field of each Java class to the corresponding object-types and object-type tables (see "Configuring an Object-Relational Mapping").

Table 20-4 describes the components of a relational project for an object-relational database.

Table 20-4 Components of a Relational Project for an Object-Relational Database

Component Supported Types

Data Source

For more information, see the following:

Descriptors

For more information, see "Object-Relational Descriptors".

Mappings

For more information, see the following: