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.
Multi-Tenancy & Extensibility: Blazing the Trail to JPA 2.1 in EclipseLink
One of the major themes of Java EE 7 and JPA 2.1 is multi-tenancy and EclipseLink, the JPA 2.1 reference implementation, has blazed the trail by shipping support for both multi-tenancy and tenant specific extensions in the Eclipse Indigo release. EclipseLink multi-tenancy enables the use of a single persistence unit by multiple tenants while keeping their data isolated and secure. But to provide a SaaS platform EclipseLink also provides tenant specific extensions so that each tenant can augment JPA entities with the additional data they need to capture and maintain. In this session we will: · Look at the challenges presented by multi-tenancy in Java EE and JPA · Explore the EclipseLink JPA multi-tenancy and extensibility features · Introduce the EclipseLink MOXy extensibility features that enable exposing multi-tenant and extended data over REST · Explore a complete multi-tenant Java EE application that supports dynamic tenant provisioning and customization This session will include live demos.