If the objects that you want to map have multi-part keys (i.e., a combination of fields that determines uniqueness), you can use EclipseLink's '''@XmlKey''' and '''@XmlJoinNodes''' to set up this relationship.

+

−

+

−

One or more '''@XmlKey''' annotations can be used to declare the primary keys in a given class. For a single key, either '''@XmlID''' or '''@XmlKey''' can be used. For composite primary keys, multiple '''@XmlKey''' annotations can be used, or a single '''@XmlID''' can be combined with one or more '''@XmlKey''' annotations.

+

−

+

−

In this example, each '''Employee''' has one '''manager''' but multiple '''reports''', and '''Employees''' are uniquely identified by the combination of their '''id''' and '''name''' fields.