Apache ObjectRelationalBridge (OJB) is an open‑source object/relational mapping (ORM) framework for the Java programming language. Developed under the auspices of the Apache Software Foundation, OJB provides a mechanism for persisting Java objects to relational database tables and for retrieving data from databases into Java objects, thereby reducing the need for explicit SQL in application code.
History and Development
OJB originated in the late 1990s as a commercial product named “ObjectRelationalBridge” created by the company OJB, Inc. In 2002, the source code was contributed to the Apache Software Foundation and the project was established as an Apache Top-Level Project. The framework reached its final major release, version 1.0.4, in 2008. Development activity declined thereafter, and the project was moved to the Apache Attic—a repository for projects that are no longer actively maintained—in 2009.
Architecture and Features
- Mapping Descriptor: OJB uses XML descriptor files (or Java annotations in later extensions) to define the correspondence between Java classes, fields, and database tables, columns, and primary keys.
- Persistence API: The framework supplies a PersistenceBroker API that offers CRUD (create, read, update, delete) operations, query execution, and transaction management.
- Query Language: OJB supports a proprietary query language (OQL) as well as native SQL. It also provides a Criteria API for programmatic query construction.
- Caching: The framework includes a first‑level (session) cache and optional second‑level caching mechanisms to reduce database round‑trips.
- Database Support: OJB is compatible with major relational databases, including Oracle, MySQL, PostgreSQL, Microsoft SQL Server, and IBM DB2, via standard JDBC drivers.
- Integration: Historically, OJB has been used in conjunction with other Apache projects such as Apache Torque and Apache Struts, and it was often cited as a predecessor to Apache OpenJPA.
Licensing
Apache OJB is distributed under the Apache License, Version 2.0, which permits free use, modification, and redistribution of the software under the terms of the license.
Current Status
As of the latest information available, Apache OJB is no longer actively maintained. The project’s source code remains archived in the Apache Attic repository, and it is considered deprecated in favor of more contemporary ORM frameworks such as Hibernate, EclipseLink, and Apache OpenJPA. Users requiring ongoing support or new feature development are generally advised to migrate to these alternatives.
References
- Apache Software Foundation, “Apache OJB Project.” Archived project page, https://attic.apache.org/projects/ojb.html.
- “Apache OJB – ObjectRelationalBridge 1.0.4 Documentation,” Apache OJB Documentation, 2008.
Note: All information presented reflects documented historical records and released versions of the Apache OJB project.