Oracle TopLink Developer's Guide
10g Release 3 (10.1.3) B13593-01 |
|
![]() Previous |
![]() Next |
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 Databasexdb.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").
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: |
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:
Define structured object-types in the database.
Define tables of the structured object-types in the database.
Define the Java classes that will map to the structured object-types.
Create a relational project (see "Creating a Project").
Create an object-relational descriptor for each Java class (see "Creating an Object-Relational Descriptor").
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: |