@XmlJavaTypeAdapter (jaxb)

The JAXB @XmlJavaTypeAdapter annotation is used with the framework-provided PersistentEntityAdapter to instruct JAXB to serialize references to persistent entities using the canonical OidDto complex type: the object’s type and its identifier. This is the formal XML equivalent to the Bookmark provided by the BookmarkService.

For example:

@XmlJavaTypeAdapter(PersistentEntityAdapter.class)
public class ToDoItem ...  {
    ...
}

This annotation therefore allows view models/DTOs to have references to persistent entities; a common idiom.

For a more complete discussion of writing JAXB view models/DTOs, see this topic in the user guide.