BT

InfoQ Homepage News Easy Persistent Entity Transfers

Easy Persistent Entity Transfers

This item in japanese

This item in chinese

Bookmarks

Gilead is a library which enables the ability to,

send persistent entities outside the JVM without pain.

Gilead, which stands for Generic Light Entity Adapter, was previously named Hibernate4GWT. The name change came after the developers began supporting other frameworks,

Since Gilead now handles more than just GWT front-end, and support of other JPA implementations than Hibernate is planned, we looked at a more generic name.

The primary reason Gilead was created was to ease the pain that is sometimes incurred when sending persistent entities to other systems or front-end technologies. Usually the problem occurs because the persistence frameworks will alter classes during compilation or runtime, to include information they require, to ease the pain related to persisting entities. Then when these altered objects are passed around strange things happen and errors such as "NoClassDefFoundError", "ClassCastException" are thrown by the receivers.

Gilead gets around this by using a clone and merge strategy. When objects are being sent out from the server they are cloned,

Clone takes a persistent entity and creates a neutral instance, without neither proxies nor persistent collection.

When the objects are being returned to the server they are merged and Gilead performs this in one of three "modes".

  1. stateless: Your classes must extend LightEntity or implement ILightEntity which enables the persistence information to be stored on the cloned object (no information is left on the server).
  2. stateful: The persistence information is stored in the HTTP session.
  3. dynamic proxy: An experimental, stateless mode useful in situations where existing code can not be modified to fulfill the requirements set forth by the stateless mode.

Gilead is currently at version 1.2.2 and provides stable clone/merge operations for applications which use Hibernate as their JPA framework. The stable adapters provided by Gilead for sending entities to front-end technologies include GWT and Flex (using BlazeDS).

The next release, version 1.3, plans for an XML/Web Services adapter, support for OpenJPA (with EclipseLink later on the road map) and other improvements.

Rate this Article

Adoption
Style

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Community comments

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

BT

Is your profile up-to-date? Please take a moment to review and update.

Note: If updating/changing your email, a validation request will be sent

Company name:
Company role:
Company size:
Country/Zone:
State/Province/Region:
You will be sent an email to validate the new email address. This pop-up will close itself in a few moments.