Map to object-relational data type nested tables (the Array type in JDBC and the NESTEDTABLE type in Oracle Database)

40.1.1 Object-Relational Data Type Structure Mapping

In an object-relational data type data model, structures are user-defined data types or object types. This is similar to a Java class–it defines attributes or fields in which each attribute is one of the following:

A primitive data type.

Another structure.

Reference to another structure.

TopLink maps nested structures with the StructureMapping class. The structure mapping supports null values and shared aggregates without requiring additional settings (because of the object-relational data type support of the database).

40.1.2 Object-Relational Data Type Reference Mapping

In an object-relational data type data model, structures reference each other through refs–not through foreign keys (as in a traditional data model). Refs are based on the target structure's ObjectID. They represent an object reference in Java.

TopLink maps refs with the ReferenceMapping class. The reference mapping does not require foreign key information (because of the object-relational data type support of the database).

40.1.4 Object-Relational Data Type Object Array Mapping

In an object-relational data type data model, structures can contain arrays (collections of other data types). These arrays can contain primitive data types or collections of other structures.

TopLink maps arrays of structures with the ObjectArrayMapping class. An object array mapping defines a collection-aggregated relationship, in which the target objects share the same row as the source object.

40.1.5 Object-Relational Data Type Nested Table Mapping

Nested table types model an unordered set of elements. These elements may be built-in or user-defined types. You can view a nested table as a single-column table or, if the nested table is an object type, as a multicolumn table (with a column for each attribute of the object type).

TopLink maps nested tables with the NestedTableMapping class. It represents a collection of object references in Java. Because of the object-relational data type support of the database, nested table mapping does not require foreign key information (as with a one-to-many mapping) or a relational table (as with a many-to-many mapping).