Skip Headers
Oracle® TopLink Developer's Guide
10g Release 3 (10.1.3.1.0)

Part Number B28218-01
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
View PDF

12 Customization

This chapter includes the following sections:

Overview

By design, TopLink can adapt to a variety of relational and nonrelational data sources.

To integrate TopLink with a data source that is not directly supported by the TopLink API, Oracle recommends that you use an EIS project (see "EIS Projects") or a XML project (see "XML Projects").

Using an EIS project, you can integrate your TopLink-enabled application with any nonrelational data source that supports a J2C) adapter and any supported EIS record type, including indexed, mapped, or XML. If no J2C adapter exists for your target data source, you can concentrate your integration efforts on creating an adapter. Simultaneously, you can build your application according to J2C specifications. Although this still requires custom development effort, it is more efficient than trying to extend TopLink classes and provides you with a J2C adapter that you can leverage in any other project (making it a better value).

Using an XML project, you can integrate your TopLink-enabled application with Web services or other XML-message based designs.

The remainder of this chapter describes other customization options provided by the TopLink API.

Creating Custom Data Types

TopLink provides support for all the most common Java data types. Table 12-1 lists the TopLink mapping extensions that you can use to support custom data types. You can also create your object converter to allow conversion between a data type and your own Java type.

Table 12-1 Mapping Extensions for Custom Data Types

Extension Description

"Object Type Converter"


An extension of direct and direct collection mappings that lets you match a fixed number of data values to Java objects. Use this converter when the values in the schema differ from those in Java

"Serialized Object Converter"


An extension of direct and direct collection mappings that lets you map serializable objects, such as multimedia data, to a binary format in a data source, such as a base64 element in an XML document or Binary Large Object (BLOB) field in a database

"Type Conversion Converter"


An extension of direct and direct collection mappings that lets you explicitly map a data source type to a Java type. For example, a java.util.Date in Java can be mapped to a java.sql.Date in the data source.

"Simple Type Translator"


An extension of direct and direct collection mappings that lets you automatically translate an XML element value to an appropriate Java type based on the element's <type> attribute as defined in your XML schema.


Using Public Source

The source code to most public classes is available in <TOPLINK_HOME>\jlib\source.jar.

This is provided for debugging purposes.