EclipseLink – Youngest Open Source Project provides venerable Java Software – TopLink’s enterprise level Object Relational and Object XML mapping now open source

1

Some months ago, Oracle announced its plans to donate the high end Object Relational Mapping Framework TopLink to the open source community. To be more specific: under the EclipseLink it will be part of the Eclipse platform. The EclipseLink homepage can be found at: http://www.eclipse.org/eclipselink/ . At this point, no software can be downloaded from that homepage: the Toplink software is currently undergoing package name changes (everything that used to be oracle.toplink. is changed into org.eclipse….) and will be available from the Eclipse repositories in the first weeks of August.

However, the software that will be EclipseLink is already available, as Oracle Toplink 11g Preview. The first incarnation of EclipseLink will be (based on) the 11gR1 release of Oracle Toplink. From then on, it will be the reverse: Oracle Toplink will be based on EclipseLink. And to be more exact: except for a little bit of application server integration code (to fit EclipseLink/TopLink into the Oracle Application Server), all of TopLink will be in the open source product EclipseLink. Oracle is not holding back on any of the advanced caching, locking, query language or advanced mapping features – everything is made public.

What you may know or not know: TopLink started life around 1994/1995 in the SmallTalk community: it even predates the Java programming language! Over more than 12 years, it has grown, matured to a very rich Object Mapping Framework – not just Object Relational but Object XML as well. In 2002 TopLink was acquired by Oracle Corporation and subsequently integrated with a range of other Oracle products, including the Application Server, JDeveloper, the BPEL engine and other components of the SOA Suite.

Further developments assured its position as the richest, most advanced, most mature Object Relational mapping framework. In 2005/2006, TopLink Essentials – a stripped down version of TopLink, provided the (open source) JPA (EJB 3.0 Java Persistence API) reference implementation that is shipped in the GlassFish application server. In 2007, the entire product becomes open source. Organizations around the world who before decided against TopLink because of Open Source guidelines or lack of (license) budget, can now reassess the ORM scene – when it comes to functionality, reliability, stability, scalibility, standards compliance and performance – they will be hard pressed to find a better option than EclipseLink.

Functional Areas in EclipseLink

At the heart of EclipseLink (as in TopLink 11g) is of course Object Relational Mapping – the mapping between the (OO) Domain Model and the relational database Table Model. However, the objective of EclipseLink goes way further than just ORM: the domain model can be mapped to multiple persistence technologies:

  • Efficiently manipulate XML through a Java domain model using JAXB
  • Interact with unstructured data through Service Data Objects (SDO)
  • Expose relational datbases flexibly using Web Services
  • Interact with EIS (standard Applications, Legacy environments) through JCA

Data retrieved from any of these technologies is approached by your Java application in the same way, is cached by EclipseLink in the same way and allows the same of access through the EclipseLink QL (Query Language).

JPA

EclipseLink provides a JPA 1.0 compliant implementation – and goes beyond that. As is required in most more serious applications, EclipseLink extends JPA with more advanced caching and locking features, support for stored procedures and a richer Query Language. The use of a shared cache – across all of the JVM, so for example across sessions in a Web Application – means reduced communication with the database resulting in much better performance in most applications. Note: you develop your application against the standard JPA, only adding annotations or mapping instructions that are understood by EclipseLink and not by other implementations. This means that while moving the application to another JPA implementation means a loss of some advanced features, the application will continue to compile and by and large to function , at least where it concerns performance and scalability enhancements based on EclipseLink’s caching.

EclipseLink adds a number of annotations to the JPA 1.0 set, including:

  • @Converter – to specify the automatic conversion of database column values to specific Java Objects, for example 0 and 1 in the database become a Boolean in Java or comma separated values String is turned into a HashMap.
  • @Cache – to specify special Cache settings per entity
  • @NamedStoredProcedureQuery – to leverage a Stored Function returning a cursor (ResultSet)
  • @OptimisticLocking – to specify a more intricate optimistic locking strategy (rather than just using @Version)

Also see: http://www.oracle.com/technology/products/ias/toplink/JPA/resources/toplink-jpa-extensions.html (JPA Extension in EclipseLink) and How to leverage Oracle TopLink’s advanced features through JPA.

 

MOXy for Java-XML mapping

Many years ago, the TopLink developers needed an easy way to read the TopLink mapping files (XML based) and turn them into Java Objects. The TopLink Workbench – the design time mapping environment – also needed to be able to write those XML files from in memory object structures. Over time this requirement was turned into a generic Object/XML mapping infrastructure. Subsequently, this functionality was made available to TopLink users as well – as an additional Persistence-Mapping technology. Note: this all happened long before the JAXB standard was created.

In EclipseLink, MOXy is probably the second most important module – next to the Object-Relational Mapping framework -, providing an advanced XML to Object mapping infrastructure. MOXy implements the JAXB 1.0 standard and is on the verge of implementing JAXB 2.0 as well (see for example Marshalling POJOs with JAXB using Toplink 11g (2bka EclipseLink).

MOXy has a number of important characteristics that should make it a favorite for XML Marshalling and Unmarshalling: speed and efficiency (low footprint, does not need to do full document parsing in order to unmarshal subset of elements), document preservation, flexible mapping, support for any JAXP compliant parser (SAX, DOM and StAX).

Moving Further

Relatively new areas in EclipseLink are

  • the support for DBWS – providing simplified access to relational data through WebServices (for example for SOA environments) that are generated/implemented using EclipseLink (this started with the implementation of Database Adapters for Oracle’s BPEL Engine)
  • Support for SDO (Service Data Objects)
  • EclipseLink EIS – JCA support with out of the box implementations for MQSeries, Oracle Advanced Queuing, Sun JCA, XML Files
  • the upcoming support for OSGI – shipping EclipseLink as OSGI bundle

As stated, all of TopLink will EclipseLink – that includes the TopLink Workbench, the IDE for configuring the TopLink mapping definitions. Note: the new JPA (and JPA-like) Annotations are not supported by the Workbench – these are to be maintained in regular IDEs. JDeveloper (see for example the 11g Technology Preview) and Eclipse (through the DALI project) will have extensive support for all mappings.

The Roadmap in terms of versions and editions is outlined below. The figure illustrates how TopLink Essentials is on a separate branch from the full TopLink 11g and EclipseLink products – with mutual bug fix synchronization. Note: TopLink Essentials will not be extended with the full EclipseLink functionality, it will just be the JPA reference implementation – upgraded for JPA 2.0 when that spec will be set.

Although the EclipseLink builds are not yet available, since it will be nearly identical to TopLink 11g Preview that you can download – except for the package refactoring – you can start playing with it rightaway!

Share.

About Author

Lucas Jellema, active in IT (and with Oracle) since 1994. Oracle ACE Director for Fusion Middleware. Consultant, trainer and instructor on diverse areas including Oracle Database (SQL & PLSQL), Service Oriented Architecture, BPM, ADF, Java in various shapes and forms and many other things. Author of the Oracle Press book: Oracle SOA Suite 11g Handbook. Frequent presenter on conferences such as JavaOne, Oracle OpenWorld, ODTUG Kaleidoscope, Devoxx and OBUG. Presenter for Oracle University Celebrity specials.

1 Comment