Skip to main content
Jump to: navigation, search

Difference between revisions of "Customizing the EclipseLink Application (ELUG)"

m (New page: <div style="margin:5px;float:right;border:1px solid #000000;padding:5px">__TOC__ Related Topics</div> There are mul...)
 
m
 
(12 intermediate revisions by 5 users not shown)
Line 1: Line 1:
 +
[[Image:Elug draft icon.png]] '''For the latest EclipseLink documentation, please see http://www.eclipse.org/eclipselink/documentation/ '''
 +
 +
----
 +
 
<div style="margin:5px;float:right;border:1px solid #000000;padding:5px">__TOC__
 
<div style="margin:5px;float:right;border:1px solid #000000;padding:5px">__TOC__
 
[[Special:Whatlinkshere/Customizing the EclipseLink Application (ELUG)|Related Topics]]</div>
 
[[Special:Whatlinkshere/Customizing the EclipseLink Application (ELUG)|Related Topics]]</div>
Line 4: Line 8:
  
  
==Introduction to Customization==
+
<span id="Introduction to Customization"></span>By design, EclipseLink can adapt to a variety of relational and nonrelational data sources.
By design, EclipseLink can adapt to a variety of relational and nonrelational data sources.
+
  
To integrate EclipseLink with a data source that is not directly supported by the EclipseLink API,we recommend that you use an EIS project (see [[Introduction%20to%20EIS%20Projects%20(ELUG)|Introduction to EIS Projects]]) or a XML project (see [[Introduction%20to%20XML%20Projects%20(ELUG)|Introduction to XML Projects]]).
+
To integrate EclipseLink with a data source that is not directly supported by the EclipseLink API,we recommend that you use an [[Introduction%20to%20EIS%20Projects%20(ELUG)|EIS project]] or a [[Introduction%20to%20XML%20Projects%20(ELUG)|XML project ]]).
  
 
Using an EIS project, you can integrate your EclipseLink-enabled application with any nonrelational data source that supports a JCA adapter and any supported EIS record type, including indexed, mapped, or XML. If no JCA 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 JCA specifications. Although this still requires custom development effort, it is more efficient than trying to extend EclipseLink classes and provides you with a JCA adapter that you can leverage in any other project (making it a better value).
 
Using an EIS project, you can integrate your EclipseLink-enabled application with any nonrelational data source that supports a JCA adapter and any supported EIS record type, including indexed, mapped, or XML. If no JCA 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 JCA specifications. Although this still requires custom development effort, it is more efficient than trying to extend EclipseLink classes and provides you with a JCA adapter that you can leverage in any other project (making it a better value).
Line 20: Line 23:
 
EclipseLink provides support for all the most common Java data types. This table lists the EclipseLink 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.
 
EclipseLink provides support for all the most common Java data types. This table lists the EclipseLink 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.
  
 
+
<span id="Table 15-1"></span>
 
+
''''' Mapping Extensions for Custom Data Types'''''
'''''Table 15-1 Mapping Extensions for Custom Data Types'''''
+
  
 
{| class="HRuleFormalMax" dir="ltr" title="Mapping Extensions for Custom Data Types" summary="This table lists the mapping extensions that you can use to support custom data types." width="100%" border="1" frame="hsides" rules="rows" cellpadding="3" frame="hsides" rules="rows"
 
{| class="HRuleFormalMax" dir="ltr" title="Mapping Extensions for Custom Data Types" summary="This table lists the mapping extensions that you can use to support custom data types." width="100%" border="1" frame="hsides" rules="rows" cellpadding="3" frame="hsides" rules="rows"
Line 30: Line 32:
 
|- align="left" valign="top"
 
|- align="left" valign="top"
 
| id="r2c1-t2" headers="r1c1-t2" align="left" |
 
| id="r2c1-t2" headers="r1c1-t2" align="left" |
Object type converter (see [[Introduction%20to%20Mappings%20(ELUG)|Object Type Converter]])
+
[[Introduction%20to%20Mappings%20(ELUG)|Object Type Converter]]
 
| headers="r2c1-t2 r1c2-t2" align="left" |
 
| headers="r2c1-t2 r1c2-t2" align="left" |
 
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
 
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
 
|- align="left" valign="top"
 
|- align="left" valign="top"
 
| id="r3c1-t2" headers="r1c1-t2" align="left" |
 
| id="r3c1-t2" headers="r1c1-t2" align="left" |
Serialized object converter (see [[Introduction%20to%20Mappings%20(ELUG)|Serialized Object Converter]])
+
[[Introduction%20to%20Mappings%20(ELUG)|Serialized Object Converter]]
 
| headers="r3c1-t2 r1c2-t2" align="left" |
 
| headers="r3c1-t2 r1c2-t2" align="left" |
 
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
 
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
 
|- align="left" valign="top"
 
|- align="left" valign="top"
 
| id="r4c1-t2" headers="r1c1-t2" align="left" |
 
| id="r4c1-t2" headers="r1c1-t2" align="left" |
Type conversion converter (see [[Introduction%20to%20Mappings%20(ELUG)|Type Conversion Converter]])
+
[[Introduction%20to%20Mappings%20(ELUG)|Type Conversion Converter]]
 
| headers="r4c1-t2 r1c2-t2" align="left" |
 
| headers="r4c1-t2 r1c2-t2" align="left" |
An extension of direct and direct collection mappings that lets you explicitly map a data source type to a Java type. For example, a <code>java.util.Date</code> in Java can be mapped to a <code>java.sql.Date</code> in the data source.
+
An extension of direct and direct collection mappings that lets you explicitly map a data source type to a Java type. For example, a <tt>java.util.Date</tt> in Java can be mapped to a <tt>java.sql.Date</tt> in the data source.
 
|- align="left" valign="top"
 
|- align="left" valign="top"
 
| id="r5c1-t2" headers="r1c1-t2" align="left" |
 
| id="r5c1-t2" headers="r1c1-t2" align="left" |
Simple type translator (see [[Introduction%20to%20Mappings%20(ELUG)|Simple Type Translator]])
+
[[Introduction%20to%20Mappings%20(ELUG)|Simple Type Translator]]
 
| headers="r5c1-t2 r1c2-t2" align="left" |
 
| headers="r5c1-t2 r1c2-t2" align="left" |
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 <code><type></code> attribute as defined in your XML schema.
+
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 <tt><type></tt> attribute as defined in your XML schema.
 
|}
 
|}
  
<br />
 
  
==Using the Session Customizer Class==
 
You can customize a session at run time by specifying a session customizer–a Java class that implements the <code>org.eclipse.persistence.sessionconfiguration.SessionCustomizer</code> interface.
 
  
For more information, see the following:
 
* [[Introduction%20to%20EclipseLink%20Sessions%20(ELUG)|Session Customization]]
 
* [[Configuring%20a%20Session%20(ELUG)|Configuring a Session Customizer Class]]
 
* Persistence unit property <code>eclipselink.session.customizer</code> in [[Using%20EclipseLink%20JPA%20Extensions%20(ELUG)|EclipseLink JPA Persistence Unit Properties for Customization and Validation]]
 
  
 +
==Using the Session Customizer Class==
 +
You can customize a session at run time by specifying a session customizer–a Java class that implements the <tt>org.eclipse.persistence.config.SessionCustomizer</tt> interface.
  
 +
For more information, see the following:
 +
* [[Introduction%20to%20EclipseLink%20Sessions%20(ELUG)#Session Customization|Session Customization]]
 +
* [[Configuring%20a%20Session%20(ELUG)#Configuring a Session Customizer Class|Configuring a Session Customizer Class]]
 +
* Persistence unit property <tt>eclipselink.session.customizer</tt> in [[Using%20EclipseLink%20JPA%20Extensions%20(ELUG)#EclipseLink JPA Persistence Unit Properties for Customization and Validation|EclipseLink JPA Persistence Unit Properties for Customization and Validation]]
  
 
==Using the Descriptor Customizer Class==
 
==Using the Descriptor Customizer Class==
You can customize a descriptor at run time by specifying a descriptor customizer–a Java class that implements the <code>org.eclipse.persistence.tools.sessionconfiguration.DescriptorCustomizer</code> interface.
+
You can customize a descriptor at run time by specifying a descriptor customizer–a Java class that implements the <tt>org.eclipse.persistence.config.DescriptorCustomizer</tt> interface.
  
 
For more information, see the following:
 
For more information, see the following:
* [[Introduction%20to%20Descriptors%20(ELUG)|Descriptor Customization]]
+
* [[Introduction%20to%20Descriptors%20(ELUG)#Descriptor Customization|Descriptor Customization]]
* [[Configuring%20a%20Descriptor%20(ELUG)|Configuring a Descriptor Customizer Class]]
+
* [[Configuring%20a%20Descriptor%20(ELUG)#Configuring a Descriptor Customizer Class|Configuring a Descriptor Customizer Class]]
 
* [[Using%20EclipseLink%20JPA%20Extensions%20(ELUG)|How to Use the @Customizer Annotation]]
 
* [[Using%20EclipseLink%20JPA%20Extensions%20(ELUG)|How to Use the @Customizer Annotation]]
* Persistence unit property <code>eclipselink.descriptor.customizer.<ENTITY></code> in [[Using%20EclipseLink%20JPA%20Extensions%20(ELUG)|EclipseLink JPA Persistence Unit Properties for Customization and Validation]]
+
* Persistence unit property <tt>eclipselink.descriptor.customizer.<ENTITY></tt> in [[Using%20EclipseLink%20JPA%20Extensions%20(ELUG)#EclipseLink JPA Persistence Unit Properties for Customization and Validation|EclipseLink JPA Persistence Unit Properties for Customization and Validation]]
 
+
 
+
  
 
==Using the Descriptor Amendment Methods==
 
==Using the Descriptor Amendment Methods==
Line 77: Line 76:
  
 
For more information, see the following:
 
For more information, see the following:
* [[Introduction%20to%20Descriptors%20(ELUG)|Amendment and After-Load Methods]]
+
* [[Introduction%20to%20Descriptors%20(ELUG)#Amendment and After-Load Methods|Amendment and After-Load Methods]]
* [[Configuring%20a%20Descriptor%20(ELUG)|Configuring Amendment Methods]]
+
* [[Configuring%20a%20Descriptor%20(ELUG)#Configuring Amendment Methods|Configuring Amendment Methods]]
  
  
  
 
==Using EclipseLink JPA Extensions==
 
==Using EclipseLink JPA Extensions==
If you are developing a EclipseLink JPA application, use EclipseLink JPA metadata annotations and XML extensions for customization.
+
If you are developing an EclipseLink JPA application, use EclipseLink JPA metadata annotations and XML extensions for customization.
  
 
For more information, see [[Using%20EclipseLink%20JPA%20Extensions%20(ELUG)|Using EclipseLink JPA Extensions]].
 
For more information, see [[Using%20EclipseLink%20JPA%20Extensions%20(ELUG)|Using EclipseLink JPA Extensions]].
  
 +
 +
 +
==Using Oracle Database Proxy Authentication in JPA Applications==
 +
For information, see [[Configuring%20a%20EclipseLink%20JPA%20Application%20(ELUG)#Configuring Oracle Database Proxy Authentication for a JPA Application|Configuring Oracle Database Proxy Authentication for a JPA Application]].
  
  
Line 94: Line 97:
  
 
[[Category: EclipseLink User's Guide]]
 
[[Category: EclipseLink User's Guide]]
[[Category: Draft]]
+
[[Category: Release 1]]
 
[[Category: Concept]]
 
[[Category: Concept]]
 +
[[Category: Task]]

Latest revision as of 11:22, 18 July 2012

Elug draft icon.png For the latest EclipseLink documentation, please see http://www.eclipse.org/eclipselink/documentation/


There are multiple ways to customize your EclipseLink application, ranging from creating custom data types to using JPA extensions.


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

To integrate EclipseLink with a data source that is not directly supported by the EclipseLink API,we recommend that you use an EIS project or a XML project ).

Using an EIS project, you can integrate your EclipseLink-enabled application with any nonrelational data source that supports a JCA adapter and any supported EIS record type, including indexed, mapped, or XML. If no JCA 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 JCA specifications. Although this still requires custom development effort, it is more efficient than trying to extend EclipseLink classes and provides you with a JCA adapter that you can leverage in any other project (making it a better value).

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

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


Creating Custom Data Types

EclipseLink provides support for all the most common Java data types. This table lists the EclipseLink 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.

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 the Session Customizer Class

You can customize a session at run time by specifying a session customizer–a Java class that implements the org.eclipse.persistence.config.SessionCustomizer interface.

For more information, see the following:

Using the Descriptor Customizer Class

You can customize a descriptor at run time by specifying a descriptor customizer–a Java class that implements the org.eclipse.persistence.config.DescriptorCustomizer interface.

For more information, see the following:

Using the Descriptor Amendment Methods

To customize descriptors, you can use their amendment methods.

For more information, see the following:


Using EclipseLink JPA Extensions

If you are developing an EclipseLink JPA application, use EclipseLink JPA metadata annotations and XML extensions for customization.

For more information, see Using EclipseLink JPA Extensions.


Using Oracle Database Proxy Authentication in JPA Applications

For information, see Configuring Oracle Database Proxy Authentication for a JPA Application.



Copyright Statement

Back to the top