Skip to main content

EJB 3.0 Object-Relational Mapping Project

Introduction

The EJB 3.0 Object-Relational Mapping Project is a proposed open source project under the Eclipse Technology Project.

This project proposal is in the Proposal Phase and is posted here to solicit community feedback, additional project participation, and ways the project can be leveraged from the Eclipse membership-at-large. You are invited to comment on and/or join the project. Please send all feedback to the eclipse.technology.ejb-orm newsgroup.

Project Goal

The goal of this project is to add comprehensive support to the Eclipse Project for the definition, editing, and deployment of Object-Relational (O/R) mappings for EJB 3.0 Entity Beans.  EJB 3.0 O/R mapping support will focus on minimizing the complexity of mapping by providing creation and automated initial mapping wizards, and programming assistance such as dynamic problem identification.  The implementation will be extensible so third party vendors can add to its functionality.

Project Scope

This project will provide tooling to map EJB 3.0 Entity Beans to relational databases tables, as detailed in JSR 220: Enterprise JavaBeans™ 3.0 Persistence API.  From a J2EE perspective, this tooling would be an integrated component beside its peers in the JST project under the larger umbrella of the WTP.  It will leverage the work being done under the J2EE Core Model and Tools in the areas of J2EE Artifacts and Components and J2EE Server Tooling.  As EJB 3.0 persistence is also intended to be the persistence standard for J2SE, it will be necessary for this tooling to support non-J2EE usage.

Session and Message Driven Bean configuration is not a part of this project, as it is expected that the current JST support will be evolved to cover the changes required by EJB 3.0.  O/R mapping is not applicable to these bean types and so they are therefore out of scope.

Support for persistence technologies other than JSR 220 (e.g., JSR 222: Java™ Architecture for XML Binding (JAXB) 2.0) is out of scope.

The goal of the project is the development of tooling and frameworks to support the construction of EJB 3.0 Entity Beans, not the development of an O/R mapping framework.   The proposed tools and frameworks are all design time only.  No runtime libraries or frameworks are included in this proposal.  Runtime support for EJB 3.0 will be provided by JSR 220 compliant application server implementations.

Extension points will be provided to support vendor extensions to EJB 3.0; however, while this proposal acknowledges and supports the need for vendor extensions, the scope of this proposal is limited to the functionality defined in the EJB 3.0 specification.

At the time of this writing, the EJB 3.0 specification has not been finalized and changes are expected before the final draft is issued. Accordingly, the scope of this proposal will track the draft specification and the tooling will be validated against the EJB 3.0 reference implementation and available commerial implementations.

Project Principles

Leverage the Eclipse Ecosystem:  It is our goal to extend the Eclipse user experience as well as leverage other Eclipse project functionality where applicable.

Vendor Neutrality: We intend to build an EJB 3.0 tool that is not biased toward any particular EJB container or persistence vendor.

Extensibility:  It is our intention to provide a generic and extensible set of editors and frameworks that provide a vendor neutral ability to add proprietary O/R mapping features that extend the EJB 3.0 specification (e.g., advanced mappings and querying provided by implementations such as BEA Weblogic, IBM WebSphere, JBoss Hibernate, and Oracle TopLink).

Extensibility of the EJB 3.0 tooling will not be limited to add-ons extensions. By being architected as a set of plug-in components, individual components (e.g., Entity generation from tables) may be replaced by vendor specific implementations.

Incremental Development:  As this project will be subject to an evolving specification, an agile development process will be employed to manage and respond to changing requirements.

Standards Compliance: The project tooling will be focused on providing support for persistence Entities as defined by the JSR 220 Enterprise JavaBeans™ 3.0 specification.

Inclusiveness: Project participation by all interested parties is welcome. The initial committers, for example, are from three vendors that compete agressively in the market but recognize the value of working together on pre-competitive Eclipse-based tools and technologies.

Project Description

It is now generally accepted that tooling applied in the right scenarios can increase developer productivity, saving time and money for their organizations.  O/R mapping is one of these scenarios that has benefited from tool support in the past from providing design time validation of mappings and configuration to visually managing the mapping of large object models.  Examples of this type of tool include the Oracle TopLink Workbench, Solarmetric's Kodo Development Workbench, and the JBoss Hibernate Mapping Editor.  IDE’s will support annotations, but an O/R mapping tool should go beyond this to offer further context and intelligence to aid decision-making and reduce developer errors.

The specific intent of this project is to fill the current void in lightweight tooling support for EJB 3.0 persistence.  The project will address this void with a non-proprietary tooling solution that can be used to map to any EJB 3.0 compliant runtime implementation.  In addition, container and persistence vendors and open source projects could extend this project with proprietary plug-ins for their own advanced mapping or configuration support.  While the spec is in flux, the project would target the reference implementation for EJB 3.0 O/R Mapping.  See the diagram below for a visual representation.

As stated above, this project is 100% tooling, and should be completely decoupled from any particular runtime implementation. 

Below are areas of targeted support for the project:

EJB Specific Functionality

This section illustrates the type of mapping support intended, but is not meant to be a comprehensive list of supported functionality.

  • Basic mapping (field/column) and relationship (foreign key) mapping support
  • Embeddable Classes
  • Entity Bean Inheritance
  • Entity Manager (Query API Support)
    • Named Queries
    • EJBQL Queries
    • Native Queries
  • Entity Bean Lifecycle management
    • Callback and EntityListener configuration
  • Version Locking
  • ID Generators
  • Multi-table mapping
  • LOB mappings
  • Reading and writing of EJB 3.0 O/R Annotations
  • Reading and writing of EJB 3.0 O/R XML Descriptors
  • Creation and editing of persistence archives (.par).
  • Creation and editing of persistence.xml files.
Automation/Generation Functionality

Wizards will be provided to assist in prototyping and jump starting of projects.  Features like automated initial mapping of classes to tables based on syntactic name similarity remove much of the basic work associated with O/R mapping.

  • Automated initial mapping process for basic mappings, relationship mappings, and inheritance
  • Generation of Entity Beans from table definitions
  • Generation of table definitions from Entity Beans
Additional Functionality

Developer productivity will be enhanced with the following features.

  • Coding assistance for annotation parameters (e.g., valid table/column names)
  • Mapping assistance and validation through dynamic problem reporting
  • Ability to define and manage persistence needs of large projects
  • Visual EJBQL Builder
  • Ability to keep EJBQL queries in sync with Java class definitions in the face of refactoring
Extension Points

The project should be architected as a set of plug-ins, each of which provides the ability for other groups or vendors to further extend and customize the functionality in a well-defined manner. In particular, it is expected that the core mapping functionality would be extended by:

  • EJB 3.0 container tools
  • EJB 3.0 O/R persistence tools

Extension points will be defined to allow tool vendors and open source projects to extend the core mapping facilities with additional functionality. For example, extension points would likely be defined for the following areas:

  • Addition of mapping types
  • Addition of descriptor types
  • Extension of descriptor configuration with policies
  • Addition of query types and configuration
  • Preferences and other standard extensions
Integration Points with Other Eclipse Projects

Given the scope of the project, the EJB 3.0 O/R mapping tools will interact with and leverage the following existing Eclipse projects: 

High Level Use Cases
  • Map EJB 3.0 Entities, test in J2EE environment
    • Connect to Database
    • Import Table Definitions
    • Perform automated initial mapping on existing EJB 3.0 Entities
    • Customize mappings as necessary
    • Package EAR and PAR contents
    • Run, Test, Debug EJB 3.0 Entity Beans on J2EE server
  • Generate EJB 3.0 Entities from Tables, test in J2SE environment
    • Connect to Database
    • Import Table Definitions
    • Generate EJB 3.0 Entities (with mappings) from Table Definitions
    • Customize mappings as necessary
    • Run, Test, Debug EJB 3.0 Entity Beans on J2SE JVM
  • Generate Tables from EJB 3.0 Entities, test in J2EE environment
    • Generate Tables from existing EJB 3.0 Entities
    • Perform automated initial mapping on existing EJB 3.0 Entities
    • Customize mappings as necessary
    • Package EAR and PAR contents
    • Run, Test, Debug EJB 3.0 Entity Beans on J2SE JVM

Organization

We propose this project should be undertaken as an incubator within the Eclipse Technology Project. EJB 3.0 O/R mapping will be the Java standard persistence API for both J2EE and J2SE. As such, this project will complement WTP and DTP, which are found in the Eclipse Tools Project, and JDT which is a part of the core Eclipse project.

Initially, EJB 3.0 Expert Group members and other individuals and organizations that have serious interest will be solicited to participate.  This list would cover a broad base of organizations interested in EJB 3.0, including J2EE vendors and third party persistence providers.

The submitters of this proposal welcome interested parties to post to the eclipse.technology.ejb-orm newsgroup and ask to be added to the list as interested parties or to suggest changes to this document.

Initial Committers

The three initial contributors to this project proposal are all members of the JSR 220 EJB 3.0 expert group and bring with them significant practical experience in the area of O/R mapping technology and tooling.

  • Oracle—Oracle has committed to providing project leadership, development resources experienced in the construction of commercial quality O/R mapping tools, and an initial codebase to draw from.
  • SolarMetric—SolarMetric is contributing O/R mapping expertise and development resources experienced in commercial O/R tool development.
  • JBoss—JBoss is supporting the project through the committment of experienced O/R tool development resources and Eclipse development expertise.

The project leadership will continue to pro-actively contact interested parties to invite their contribution of code and development resources.

Back to the top