Skip Headers

Oracle TopLink Developer's Guide 10g Release 3 (10.1.3) B13593-01 |
| Home | Solution Area | Contents | Index

Previous | Next |

# Direct Map Mapping

Direct map mappings store instances that implement `java.util.Map`. Unlike one-to-many or many-to-many mappings, the keys and values of the map in this type of mapping are Java objects that do not have descriptors. The object type stored in the key and the value of direct map are Java primitive wrapper types such as `String` objects.

Figure 36-7 illustrates how a direct map is stored in a separate table with three fields. The first field (EMPID) is the reference key field, which contains a reference to the primary key of the instance owning the collection. The second field (ADDRESS) contains an object in the collection and is called the direct value field. The third field (TYPE) contains the direct key field. In this example, the direct map uses a object type converter for the direct key field, converting the single character W in the database to the full string Work in the object (and H to Home).

Figure 36-7 Direct Map Mappings

Description of "Figure 36-7 Direct Map Mappings "

You can use a direct collection mapping with any of the following `Converter` instances:

- see "Object Type Converter"

- see "Serialized Object Converter"

- see "Type Conversion Converter"

You can use a direct map mapping with a change policy (see "Configuring Change Policy".

See "Configuring a Relational Direct Map Mapping" for more information.