Tuesday, November 23, 2004

Object Relational Mapping: EJBs


We use Hibernate and avoid EJB overhead for managing persistent Java objects. Here is an overview of the EBJ strategy.

An Introduction to Java Object Persistence with EJB
by Jeff Hanson November 9, 2004

The 'impedance mismatch' between relational databases' tabular orientation and object-oriented Java's hierarchical one is a perennial problem for which the Java world has several good solution offerings. This article, the first in a three-part series, will look specifically at the EJB specification and its unique way of solving the object-relational mapping problem.

Storing and retrieving information for most applications usually involves some form of interaction with a relational database. This has presented a fundamental problem for developers for quite some time since the design of relational data and object-oriented instances share very different relationship structures within their respective environments. Relational databases are structured in a tabular configuration and object-oriented instances are typically structured in a hierarchical manner. This "impedance mismatch" has led to the development of several different object-persistence technologies attempting to bridge the gap between the relational world and the object-oriented world. The Enterprise JavaBeans (EJB) framework provides is one such means of bridging this gap.