Skip to main content
Jump to: navigation, search


< EclipseLink‎ | Examples‎ | MOXy‎ | JPA
Revision as of 12:09, 1 December 2009 by (Talk | contribs) (JAXB Bindings)


JPA Entities

public class PhoneNumber {
        @JoinColumn(name="E_ID", referencedColumnName = "E_ID"),
        @JoinColumn(name="E_COUNTRY", referencedColumnName = "COUNTRY")
    private Employee contact;
public class Employee {
    private EmployeeId id;
    private List<PhoneNumber> contactNumber;
public class EmployeeId {
    private BigDecimal eId;
    private String country;

JAXB Bindings

For this example the XML acessor type will be set to FIELD for all the model classes. This can be set as a package level JAXB annotation.

package com.example.model;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;

Back to the top