Java Data Objects
| Company type | Specification |
|---|---|
| Industry | Software, Java Persistence |
| Founded | 2002 |
| Products | Java object persistence standard |
| Website | www |
Java Data Objects (JDO) defines a standard for Java object persistence that prioritizes transparency within the domain model. Objects managed by JDO are ordinary Java classes, often referred to as POJOs, and do not require implementing particular interfaces or subclassing special classes. The specification has evolved through the Java Community Process, with iterations including versions 1.0 (JSR 12), 2.0 (JSR 243, May 2006), 2.1 (February 2008, Apache JDO project), 2.2 (October 2008), and 3.0 (April 2010).
Persistence metadata is typically maintained in separate XML configuration files, which may include vendor-specific extensions. Providers supply enhancers—tools that modify compiled Java bytecode to enable seamless persistence functionality. Although bytecode enhancement is a common practice, it is not explicitly required by the JDO standard. The specification supports various persistence targets such as RDBMS, OODB, and file systems.
JDO-enhanced classes maintain portability across different vendor implementations, enabling the same Java class to operate with any compliant JDO framework.
Integration with Java EE occurs through vendor implementations acting as JEE Connectors and compatibility with JEE transaction services.
Comparison: JDO, EJB3, and JPA
Persistence capabilities were also addressed by Enterprise JavaBeans version 3.0 (EJB3), which evolved from EJB v2's Entity Beans, resulting in overlapping standards and some competition. Persistence functionality was eventually extracted from EJB3 Core to form the separate Java Persistence API (JPA), initially defined in JSR 220 and later formalized as an independent specification under JSR 317. Unlike EJB containers, the javax.persistence API operates seamlessly in both Java SE and EE environments, similar to JDO.
While JPA primarily targets object-relational mapping (ORM) for relational databases, JDO offers support for both ORM and transparent object persistence and remains datastore-neutral. Certain JPA providers such as DataNucleus and ObjectDB extend their capabilities to non-relational datastores through the JPA interface.
Many prominent commercial and open source JDO implementations provide alternative access via a JPA API, complementing their original JDO-based persistence engines. A variety of open source implementations of JDO are available.
Enhancements Introduced in JDO Version 2 Compared to Version 1
- Introduction of disconnected object graph support
- Standardized descriptors for ORM mapping tailored to ORM-oriented JDO implementations
- Improvements in JDOQL: single-string query form; broadened method support for String, Map, and Math classes
- Capability to retrieve resources such as java.sql.Connection through
javax.jdo.PersistenceManager - Additional functionalities including Named Queries (via pm.newNamedQuery), FetchPlan configuration, Sequence support, Delete by Query operations, and multiple User Objects per PersistenceManager
Reference Implementations of JDO
- Version 1.0: FOStore
- Version 2.0: JPOX 1.1
- Version 2.1: JPOX 1.2
- Version 2.2: DataNucleus AccessPlatform 1.0.1
- Version 3.0: DataNucleus AccessPlatform 2.1.0
- Version 3.1: DataNucleus AccessPlatform 3.2.0
- Version 3.2: DataNucleus AccessPlatform 5.2.0
See also
- Object database
- Object-relational mapping
- Java Persistence API (JPA)
- DataNucleus
- ObjectDB
- ActiveJPA
Bibliography
- David Jordan, Craig Russell (2003). Java Data Objects. O'Reilly Media. 384 pages. ISBN 0-596-00276-9
- Sameer Tyagi et al. (2003). Core Java Data Objects. Prentice Hall. 576 pages. ISBN 0-13-140731-7
- David Ezzio (2003). Using and Understanding Java Data Objects. Apress. 456 pages. ISBN 1-59059-043-0