7.6. BlazeDS Adapter for JPA and Hibernate

This section explains facets of a JPA and Hibernate adapter for BlazeDS and walks through some of the core concepts involved in writing such an adapter.

Writing a JPA or Hibernate adapter involves two distinct tasks:

  • Writing to the BlazeDS API so that the adapter can hook onto the existing infrastructure

  • Incorporating the JPA and Hibernate semantics so that the behavior is consistent and the benefits of JPA and Hibernate are leveraged

Chapter 9 explains the nuances of writing an adapter in detail, so I will not repeat the same content here. The only point worth mentioning is that a Hibernate adapter could best be written by extending the built-in JavaAdapter. If you want to learn more, then jump over to Chapter 9 and come back after reading it.

In this section, the focus is on understanding the complexities involved in incorporating the JPA and Hibernate semantics. JPA and Hibernate return persistent entities and their collections with built-in proxy, which as its name suggests sits in place of the real data. The proxy helps lazily load data sets and provides for efficient management of entities and their collections. These entities and their collections lie within a JVM. When you integrate these persistence layers into a Flex application, you expose these entities and their collections to a language and environment beyond what they are scoped for.

BlazeDS is capable of serializing and transforming Java-based objects to their AS3 counterparts ...

Get Professional BlazeDS: Creating Rich Internet Applications with Flex® and Java® now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.