Is it possible to specify object-relational mappings between EJBs?
Yes it is possible to specify object-relational mappings between EJBs. This can be done in two ways. 1. The OC4J EJB container implements the O-R mapping feature as prescribed in the draft EJB 2.0 specification. Since the specification is not yet finalized, this feature may change as specified in the final version of the EJB 2.0 specification. 2. The EJB container also implements an O-R mapping that is not dependant on the EJB 2.0 specification. To use this perform the following steps. Declare a normal attribute for the “one” side of the relationship, but give it a type of Set, Collection, or whatever the appropriate type is. For example: public Set children; public Set getChildren() { return children; } public void setChildren(Set children) { this.children=children; } Then, declare one more variable: public static final Class children_type=com.es.ejb.Child.class; On deployment, a linking table will be created for you. Even better, you have to write nothing to make use of it; you just