Introducing EclipseLink

Tags:

The Eclipse Persistence Services Project, more commonly known as EclipseLink, is a comprehensive open source persistence solution.  EclipseLink was started by a donation of the full source code and test suites of Oracle's TopLink product. This project brings the experience of over 12 years of commercial usage and feature development to the entire Java community. This evolution into an open source project is now complete and developers will soon have access to the EclipseLink 1.0 release.

We describe EclipseLink as a comprehensive solution because it delivers not one, but a set of persistence services enabling developers to efficiently develop applications that access data in a variety of data sources and formats.  EclipseLink's services currently include object-relational with JPA, object-XML binding in MOXy (with support for JAXB), and a Service Data Objects (SDO) implementation sharing a common mapping core. EclipseLink’s most popular persistence service is dealing with relational databases through JPA. In this article I'll introduce the EclipseLink JPA implementation and some of its advanced features.  We'll delve into the other persistence services in future articles.


JPA and Beyond

EclipseLink 1.0 supports JPA 1.0 and also offers many advanced features. The project's intent is to deliver a standards based solution focussed on JPA but with the abilitity to use advanced features for those applications where they are required. By focusing first on JPA, the EclipseLink project enables broad integration and minimizes coupling. With the recent announcement that EclipseLink will be delivering the reference implementation of JPA 2.0 (JSR 317) the project team will continue to lead the standardization of many of the advanced features. 

Advanced object-relational mappings in EclipseLink JPA offers greater flexibility when dealing with complex or legacy relational schemas. This mapping support has evolved over many years of commercial use dealing with many 'interesting' (i.e., challenging) domain models and relational schemas. The resulting support is supported through JPA where possible and configurable with EclipseLink specific mappings when no cooresponding features exists in JPA.  As mentioned above, some advanced features are making their way into JPA 2.0 and over time you can expect the use of implementation specific features to decline as the specification evolves.


Converters

Converters allow developers to customize how database values are converted into the domain model and how these values are then written back into the database. This supports user-defined types as well as custom conversion logic that can be used with any mapping. Converters are defined once for a persistence unit and can then be used in any entity through their unique name. All converters implement EclipseLink's Converter interface.

@Converter(name="money-converter", converterClass=mypackage.MyMoneyConverter.class)

...

@Convert("money-converter")
private Money balance;

The above example shows how a developer can write their own converter class and then define it under a user provided name.  Once defined, a Converter can be attached to any number of mappings through the @Convert annotation or in an XML mapping file. EclipseLink also provides out of the box converters for handing primitive value and type conversions and some database specific data types.

Article Type: 
How-to
0
Average: 5 (1 vote)

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)

Comments

Vijay Nair replied on Tue, 2008/07/01 - 12:10pm

HI, Does this support out-of the box integration with Coherence as the second level cache or even ehCache ?

 

Didnt see any property setting for that anywhere in the examples

 

Tks..VJ 

Doug Clarke replied on Tue, 2008/07/01 - 3:10pm

VJ,

EclipseLink 1.0 has added cache interceptors to enable us to leverage grid caching solutions such as Oracle's Coherence. The actual implementation for Coherence is not available yet but is being worked on and we hope to attract other grid vendors to integrate their solutions as well. The approach taken allows you to leverage the grid as more then just a simple data cache. You should be able to leverage its distributed data porocessing capabilities for query execution and concurrency protection.

For the 1.1 release I hope to have an implementation that iullustrates how an alternate caching solution such as ehCache could be used. If interested in learning more please post a question to the users mailing list or newsgroup and we can get you connected with the developers working on the solution and the technical details necessary to use it.

I also recommend looking at our cache coordination support that is offerred out of the box. It addresses minimizing stale data in the cache in a clustered deployment.

Doug 

 

r_sudh replied on Thu, 2008/07/03 - 3:12pm

From what I've read so far I haven't been able to figure out if JPA 2.0 will have a Criteria API.

Will EclipseLink 1.0 have a Criteria API or will it be included in a future release of EclipseLink as part of the JPA 2.0 implementation or as an extension?

 sud

gyorke replied on Fri, 2008/07/04 - 8:41am

As mentioned in the Early Draft a critera API for JPA 2.0 is planned.  Some of the API should be in the next Draft of the specification.  I would rather not comment on the structure of the criteria API right now as the definition is in the very early stages.

--Gordon 

Mike Keith replied on Fri, 2008/07/04 - 8:44am in response to: r_sudh

Sud,

JPA 2.0 will have a Java-based expression language (sometimes called a "criteria API").  It will not be as powerful as the existing native TopLink expression API, but will offer all of the current functionality in JP QL, plus more as possible and appropriate. Although EclipseLink already includes support for a Java expression/criteria API, it will also include the new JPA 2.0 API once we have fully specified it. The EclipseLink API will continue to be offered, though, so you can use that now and migrate to the JPA version when it is specified and implemented.

-Mike

Donny A. Wijaya replied on Tue, 2008/07/08 - 10:33pm

I wonder if these annotations would be available via XML mappings? Would they (the annotations) become part of JPA standard or just part of EclipseLink? But anyway the EclipseLink looks great, StoredProc and Converter are what I want to see in the next JPA

djclarke replied on Wed, 2008/07/09 - 4:37am in response to: fenrir

Donny,

Yes, all of the advanced features configured using annotations can also be done using XML.

For the example provided in the article I can have an EclipseLink-ORM.XML file containing:

    <converter name="money-converter" class="mypackage.MoneyConverter"/>

Then when I wish to use it on a mapping:

            <basic name="balance">
<convert>money-converter</convert>
</basic>

In EclipseLink 1.0 these XML files can be used in place of the standard JPA ones or as overrides with just the advanced features specified to enable greater portability between vendors.

It is our goal to continue to drive the advanced features we have added based on user requirements back into future versions of the standards. I will leave it to our expert group memebers to comment on the specifics but you can also get more involved by providing feedback directly to the expert group and reviewing all of the drafts that they publish (http://www.jcp.org/en/jsr/detail?id=317).

Doug

r_sudh replied on Thu, 2008/07/10 - 2:32pm

Thanks for the response about the Criteria API. Can you shed some light on the integration with Teneo - the EMF to JPA persistence framework.

I'm investigating the feasibilty of an EMF - JFace Databinding - Teneo - EclipseLink - Derby stack for a rich client application and anything that makes this seamless/painless would be very helpful.

-sud 

hallowman replied on Fri, 2009/02/06 - 7:53am

HI, Does this support out-of the box integration with Coherence as the second level cache or even ehCache ?

regards,

Buy Essay

 

 

crazzy replied on Wed, 2009/03/11 - 9:12am

But anyway the EclipseLink looks great, StoredProc and Converter are what I want to see in the next JPA..

regards,

Thesis

Rick Mark replied on Thu, 2009/03/26 - 4:51am

EclipseLink would be great as its features are using annotations as well as XML. I really need some guidance for EclipseLink for my Essay 

Dissertation Writing

Hank Freid replied on Mon, 2009/04/20 - 2:02pm

Awesome, EclipseLink is really great as its features are using annotations as well as XML. i will go for my TestKing Exam for 642-901 Exam for this.

jimjones replied on Tue, 2009/04/21 - 1:21pm

EclipseLink is a very helpful - can't wait to try it out.

Jim
Atlantic City Discrimition Law

styles992 replied on Sat, 2009/04/25 - 4:41am

prom hairstyles for 2009

styles992 replied on Sat, 2009/04/25 - 5:04am

2009 prom hairstyles hairstyles for prom

Hueyloo replied on Tue, 2009/04/28 - 8:57am in response to: vn50788

"developers will soon have access to the EclipseLink 1.0 release"

Where can I find more information on the release?

Tim

Fireplace designs | Mattress reviews | Laptop reviews

davidhussy replied on Wed, 2009/04/29 - 9:00am

Wow ! excellent introduction about the eclipse link really very detailed and clear . Free Arabic Music||Cod Liver Oil

emil300 replied on Sat, 2009/05/02 - 12:04pm in response to: Hank Freid

wonder if these annotations would be available via XML mappings? Would they (the annotations) become part of JPA standard or just part of EclipseLink? But anyway the EclipseLink looks great, StoredProc and Converter are what I want to see in the next JPA desene animate

mechanix replied on Sun, 2009/05/03 - 4:50am

Great work..Kudos for sharing this out.

Cod Liver Oil

Free Arabic Music

panettiere83 replied on Sat, 2009/05/09 - 4:30am

The approach taken allows you to leverage the grid as more then just a simple data cache.
online law school degree | online social science degrees | accredited online psychology degree

realew1 replied on Sun, 2009/05/10 - 4:24pm in response to: gyorke

You may be missing the most powerful way to do this. If your method has any side effects, or depends on any side effects, calling the method again the way you describe may not be sufficient. You often need to just "back up" to before the method was called, set the breakpoint, and start stepping again. assignment | assignments | assignment writing | buy assignment | custom assignment | assignment help | online assignment

Jameson1 replied on Thu, 2009/05/21 - 12:46pm

This was just what I was looking for, great resource. Bookmarked.    .     Norton 360 3.0 Coupon    .  Paddy Power Bingo Voucher   . Vistaprint Coupon      .     Adobe CS4 Coupon   .    Thanks.      

crazzy replied on Sun, 2009/05/24 - 3:46am in response to: vn50788

it will also include the new JPA 2.0 API once we have fully specified it. The EclipseLink API will continue to be offered, though, so you can use that now and migrate to the JPA version when it is specified and implemented.

thanks.

regards,

Kevin - predictive analytics

Michaelz replied on Mon, 2009/06/08 - 3:38am

EclipseLink is an open source object-relational mapping package for Java developers. It provides a powerful and flexible framework for storing Java objects in a relational database or for converting Java objects to XML documents.

 

great,

depeche mode tickets

AlbertMARKET replied on Thu, 2009/06/11 - 12:20am

EclipseLink has been a very helpful tool in being a Webmasters, I hope there will be better releases of it. Ways to Make Money Online How to Make Money Online

eugeneba replied on Wed, 2009/06/17 - 2:19am

The EclipseLink project provides a runtime persistence solution focussed on leading standards and extended functionality needed for today's enterprise Java and SOA application development.

 

regards,

Whiplash Claim

emad964 replied on Wed, 2009/06/17 - 7:38pm

تحميل برامج برامج جوالات العاب بنات تكنولوجيا كتب تعليم UltraSurf Internet Download Manager ProgDVB برامج مجانية أفضل المواقع العربية مشاهدة محطات مشفرة Online TV Player 3.0.0.940 Internet Download Manager 5.17 Build 4 رقص شرقي anyTV Pro 4.32 OnLineLive 7.1.1 هزي يانواعم ProgDVB 6.06.2 SopCast 3.0.3 Falco Image Studio 3.6 لعبة تزلج على الجليد UltraSurf 9.4 كاثرين هيغل Katherine Heigl محطة غنوة FreeZ Online TV 1.0 Free Video to Mp3 Converter 3.1.3.51 Advanced MP3 Converter 2.10 Xilisoft Video to Audio Converter 5.1.23.0515 Blaze Media Pro 8.02 AKRAM Media Creator 1.11 DVD Audio Extractor 4.5.4 Free WMA to MP3 Converter 1.16 لعبة نينجا المتقدم لعبة قذف كرة لعبة دراجات البهلوانية لعبة اعداء الغابة تحميل برامج Download DivX Subtitles 2.0 BullGuard 8.5 Google Chrome 2.0.181.1 Dev Dell Studio XPS Desktop 435T Intel Matrix Storage Manager A00 Gigabyte GA-EP45-UD3P Bios F9 Ambush HDConvertToX 1.1.229.1764 MSI Wind Nettop CS 120 Realtek Audio Driver 5.10.0.5618 Biostar T41-A7 6.x Realtek On-Board Audio Driver 5.10.0.5735 for 2000/2003/XP TweakNow RegCleaner 4.1.1 SpeedItup Free 4.97 برامج العاب - Internet Download Manager - برامج جوالات - العاب - محطة غنوة - قنوات فضائية - بنات - تكنولوجيا - كتب تعليم - UltraSurf -

knowledgebase replied on Fri, 2009/06/19 - 7:20am

Eclipselink is Eclipse Persistence Services Project, version 1.0 was released July 9, 2008. See http://www.eclipse.org/eclipselink/ I won’t go into the history and general explanations. For some background on Eclipelink see http://eclipse.dzone.com/articles/introducing-eclipselink. I will say that Eclipselink based on 12 years of commercial usage as Oracles’s Toplink product. Eclipselink is mature and solid.

 

thanks,

HO Trains

perceptee09 replied on Fri, 2009/06/19 - 7:44am

Nice Post Nimesh – Perception System http://www.perceptionsystem.com/

dany123 replied on Sun, 2009/06/21 - 7:29am

EclipseLink is an open source object-relational mapping package for Java developers. It provides a powerful and flexible framework for storing Java objects in a relational database or for converting Java objects to XML documents.

link building services

 

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.