Direct Known Subclasses:
DerivedIdClassAccessor, EmbeddedIdAccessor

public class EmbeddedAccessor extends MappingAccessor
An embedded relationship accessor. It may define all the same attributes as an entity, therefore, it also must handle nesting embedded's to the nth level. An embedded owning descriptor is a reference back to the actual owning entity's descriptor where the first embedded was discovered. Key notes: - any metadata mapped from XML to this class must be compared in the equals method. - any metadata mapped from XML to this class must be handled in the merge method. (merging is done at the accessor/mapping level) - any metadata mapped from XML to this class must be initialized in the initXMLObject method. - methods should be preserved in alphabetical order.
Since:
TopLink EJB 3.0 Reference Implementation
  • Constructor Details

    • EmbeddedAccessor

      public EmbeddedAccessor()
      INTERNAL: Used for OX mapping.
    • EmbeddedAccessor

      protected EmbeddedAccessor(String xmlElement)
      INTERNAL:
    • EmbeddedAccessor

      public EmbeddedAccessor(MetadataAnnotation embedded, MetadataAccessibleObject accessibleObject, ClassAccessor classAccessor)
      INTERNAL:
  • Method Details

    • addConvert

      protected void addConvert(ConvertMetadata convert)
      INTERNAL: Subclasses that support key converts need to override this method.
      Overrides:
      addConvert in class MappingAccessor
    • addMapsIdAccessor

      public void addMapsIdAccessor(MappingAccessor mapsIdAccessor)
      INTERNAL:
    • equals

      public boolean equals(Object objectToCompare)
      INTERNAL:
      Overrides:
      equals in class MappingAccessor
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class MappingAccessor
    • getAssociationOverrides

      public List<AssociationOverrideMetadata> getAssociationOverrides()
      INTERNAL: Used for OX mapping.
    • getAttributeOverrides

      public List<AttributeOverrideMetadata> getAttributeOverrides()
      INTERNAL: Used for OX mapping.
    • getConverts

      public List<ConvertMetadata> getConverts()
      INTERNAL: Used for OX mapping.
    • initXMLObject

      public void initXMLObject(MetadataAccessibleObject accessibleObject, XMLEntityMappings entityMappings)
      INTERNAL:
      Overrides:
      initXMLObject in class MappingAccessor
    • isEmbedded

      public boolean isEmbedded()
      INTERNAL:
      Overrides:
      isEmbedded in class MappingAccessor
    • process

      public void process()
      INTERNAL: Process an embedded.
      Specified by:
      process in class MetadataAccessor
    • setAssociationOverrides

      public void setAssociationOverrides(List<AssociationOverrideMetadata> associationOverrides)
      INTERNAL: Used for OX mapping.
    • setAttributeOverrides

      public void setAttributeOverrides(List<AttributeOverrideMetadata> attributeOverrides)
      INTERNAL: Used for OX mapping.
    • setConverts

      public void setConverts(List<ConvertMetadata> converts)
      INTERNAL: Used for OX mapping.
    • updateDerivedIdField

      protected void updateDerivedIdField(EmbeddableMapping embeddableMapping, String overrideName, DatabaseField overrideField, MappingAccessor mappingAccessor)
      INTERNAL: Called when process the mapsId metadata. The id fields for this owning descriptor must have it's id fields update to those from the one to one accessor that maps them. We process embedded and embedded id mappings first, so by default they get mapped and processed as they normally would. When we go through the relationship accessors and discover a mapsId we then need to make some updates to our list of primary key fields.