Class ReferenceAdapterV2<T extends org.eclipse.persistence.internal.jpa.rs.weaving.PersistenceWeavedRest>

java.lang.Object
jakarta.xml.bind.annotation.adapters.XmlAdapter<T,T>
org.eclipse.persistence.jpa.rs.util.xmladapters.ReferenceAdapterV2<T>
Type Parameters:
T - entity class of this adapter

public class ReferenceAdapterV2<T extends org.eclipse.persistence.internal.jpa.rs.weaving.PersistenceWeavedRest> extends jakarta.xml.bind.annotation.adapters.XmlAdapter<T,T>
Reference adapter used in JPARS V2. Main purpose of this adapter is retrieving an entity by link when unmarshalling.
Author:
Dmitry Kornilov
  • Field Details

  • Constructor Details

    • ReferenceAdapterV2

      public ReferenceAdapterV2()
    • ReferenceAdapterV2

      public ReferenceAdapterV2(PersistenceContext context)
      Instantiates a new reference adapter.
      Parameters:
      context - persistent context (mandatory)
  • Method Details

    • marshal

      public T marshal(T o) throws Exception
      Marshal just passes through.
      Specified by:
      marshal in class jakarta.xml.bind.annotation.adapters.XmlAdapter<T extends org.eclipse.persistence.internal.jpa.rs.weaving.PersistenceWeavedRest,T extends org.eclipse.persistence.internal.jpa.rs.weaving.PersistenceWeavedRest>
      Parameters:
      o -
      Returns:
      Throws:
      Exception
    • unmarshal

      public T unmarshal(T o) throws Exception
      If 'canonical' or 'self' link is present loads entity from the database. Otherwise uses data provided.
      Specified by:
      unmarshal in class jakarta.xml.bind.annotation.adapters.XmlAdapter<T extends org.eclipse.persistence.internal.jpa.rs.weaving.PersistenceWeavedRest,T extends org.eclipse.persistence.internal.jpa.rs.weaving.PersistenceWeavedRest>
      Throws:
      Exception