Wednesday, June 27, 2012

EclipseLink 2.4:

EclipseLink 2.4.0 Juno - RELEASED

As part of the Juno Eclipse release train the EclipseLink project has released EclipseLink 2.4.0. The release landing page describes some of the new and noteworthy features as well as providing links to documentation and examples so you can get started. What I would like to do is provide some colour commentary on the features new in this release.

JSON Binding

EclipseLink’s MOXy component has offered a JAXB compliant implementation for many years now.  It not only supports the standard JAXB features but also goes well beyond the standard to offer powerful advanced features, including XPath mappings, and support for defining mappings in XML instead of just annotations. 

In EclipseLink 2.4.0, MOXy has expanded its scope to support mapping Java objects to JSON. This support covers all of the MOXy mappings available in annotations, XML, and now JSON.  MOXy’s JSON support is enabled simply by setting the desired media-type on a marshaller or unmarshaller.  This support is unique as it marshalls/unmarshalls objects directly to and from JSON without any intermediate conversions.  And EclipseLink MOXy’s integration with EclipseLink JPA, originally written for XML mapping, makes serializing JPA entities to and from JSON easy.

HTML5/Mobile

During the development of 2.4 the team introduced JSON binding and we started building sample applications illustrating how this functionality could be leveraged with JAX-RS to simplify development. This lead us to discussions with the Jersey team as to how EclipseLink could better integrated. I parallel we continue to look at different client technologies to see what we can do in the persistence layer to simplify development. The convergence of these efforts is EclipseLink's JPA-RS feature which provides RESTful access to persistence units with either XML or JSON data formats.

What I find most interesting about JPA-RS is what it offers to developers looking to access data for Thin Server Architecture (TSA) clients. In many cases client developers just need data in a consumable (and of course efficient and secure) format and having to build a full Java EE application to expose this data can be a barrier to entry. What we have done with JPA-RS is simplified how new applications can be developed with a JAX-RS+JPA back-end with minimal server side development.

Cloud Enabled Persistence

Starting in EclipseLink 2.3 the EclipseLink team started exposing features to simplify development of applications that will be deployed in a cloud infrastructure or need to work in PaaS or SaaS scenarios. The solutions introduced included:
  • @Multitenant(SINGLE_TABLE) allowing tables to store data from multiple tenants leveraging row level filtering.
  • Extensible entities using virtual attributes so that the entity types can be customized post deployment to manage additional state.
  • MetadataSource allows overriding mapping metadata (JPA and MOXy) to be retrieved dynamically during deployment or on refresh request. This allows persistence unit customization post development so that applications can be customizable at runtime as well as supporting deployment architectures where tenant specific extensions are enabled.
In EclipseLink 2.4 we have further extended this support to include some additional tenant isolation options.
  • @Multitenant(TABLE_PER_TENANT) allows different tables in the same schema to be used per tenant or dedicated schemas per tenant.
  • MetadataSource has been extended to allow persistence unit properties, including data source information, to be dynamically provided at startup and refresh. This allows PaaS deployed application instances to retrieve isolated data source information per tenant.

NoSQL

EclipseLink, even before it was open sourced at Eclipse, offered developers support for mapping their persistent entities to non-relational data sources.  This support was done using the little known EIS features where JCA resource adapters were used and mappings were made to XML or record structures.  This core support in the foundation component has been reborn in the EclipseLink NoSQL component. This first release of EclipseLink NoSQL that ships in conjunction with our primary 2.4.0 release provides mapping and querying capabilities with MongoDB and Oracle NoSQL.

Although Object-Relational persistence for NoSQL may not apply in all scenarios it does appeal to developers who wish to use Objects and find the existing Java Persistence interfaces more natural to integrate with versus a unique data-centric API provided by the NoSQL vendors.

This area of EclipseLink persistence will be challenging given the lack of standards and wide variety of NoSQL stores available and we are hoping this first release will allow us to gain experience with how developers want to access NoSQL from their Java applications. We'll learn both where a solution like this fits well as well as where it is best not used. We will be looking to the community for feedback on the support offered, new features wanted, as well as what additional NoSQL databases we should consider supporting in future releases of EclipseLink NoSQL.

And Much More...

 We continue to evolve what a Java Persistence solution can do and have many plans for new features. The primary source of our requirements is based on our users. If you are using EclipseLink and like what you see then please let the developers know. If you don't like something we also want to hear about that. If you have never tried EclipseLink then what are you waiting for. Download the new EclipseLink 2.4 release and let us know what you think.

Feedback