Java Persistence API (JPA) Extensions Reference for EclipseLink, Release 2.4
  Go To Table Of Contents


Use @JoinField to define a structured data type's foreign key field for an object mapped to NoSql data.

Annotation Elements

Table 2-29 describes this annotation's elements.

Table 2-29 @JoinField Annotation Elements

Annotation Element Description Default


(Optional) The name of the foreign key/ID reference field in the source record.


(Optional) The name of the ID field in the target record.


The @JoinField annotation is a generic form of the @JoinColumn annotation, which is not specific to relational databases. You can use @JoinField to map EIS and NoSQL data.


These examples show how to use this extension as an annotation and in XML.

Example 2-54 Using @JoinField Annotation

public class Order {
    private Customer customer;

Example 2-55 Using <join-field> in XML

<entity name="Order" class="org.acme.Order">
    <many-to-one name="customer">
        <join-field name="customerId"/>

See Also

For more information, see: