EclipseLink: The Evolution of Java Persistence
Data access today isn’t just about reading and writing from relational databases anymore. It’s also about mapping your objects to XML and to JSON for use in RESTful web services. It’s about being able to persist your objects in NoSQL databases and being able to cache them in data grids so you can scale out your application to hundreds of servers. The EclipseLink project is well known as an object-relational mapping framework and as the JPA 2.0 reference implementation in Java EE 6, but it is evolving to provide a comprehensive set of data services for Java developers building enterprise and cloud applications in Java EE, Java SE, and in OSGi. In this session we’ll dive into these new services and see how to build modern enterprise Java applications leveraging EclipseLink both in the back end for data persistence and on the front end to build RESTful services that support HTML5 clients. Topics will include:
- EclipseLink JPA-RS—provides a service that exposes JPA mapped entities over REST either as XML with JAXB or JSON with EclipseLink JSON-B. It supports a full CRUD API as well as named query invocation.
- Resource Mapping—While JAXB and JSON-B provide a way to marshall to and from XML/JSON, RESTful services require a way to define what constitutes a resource. A naive approach of entity==resource may be used but is likely inefficient. With EclipseLink Resource Mapping the classes in a domain model can be declaratively mapped to a resource model which can be exposed using JPA-RS.
- EclipseLink Dynamic Provisioning—provides persistence services to pure HTML5 applications without the need for Java classes. With Dynamic Provisioning, HTML5 clients can dynamically define storage requirements for a set of classes (object types) and EclipseLink will instantiate a full JPA-RS CRUD service for those classes as well as JPQL query support.
- Tenant Isolation—Allow each tenant’s data to be isolated by data source, schema, table, or at the row level including support for Oracle Database Virtual Private Database (VPD). The isolation of entities carries through the persistence layers including caching.