Class ReferenceField


public class ReferenceField extends SimpleField<ObjId>
A field that references another Database object.

Null values sort last.

Reference fields are always indexed.

  • Method Details

    • getEncoding

      public ReferenceEncoding getEncoding()
      Description copied from class: SimpleField
      Get the Encoding associated with this field.
      Overrides:
      getEncoding in class SimpleField<ObjId>
      Returns:
      this field's type
    • getInverseDelete

      public DeleteAction getInverseDelete()
      Get the desired behavior when an object referred to by this field is deleted.
      Returns:
      desired behavior when a referenced object is deleted
    • isForwardDelete

      public boolean isForwardDelete()
      Determine whether the referred-to object should be deleted when an object containing this field is deleted.
      Returns:
      whether deletion should cascade to the referred-to object
    • isAllowDeleted

      public boolean isAllowDeleted()
      Determine whether this field accepts references to deleted objects in normal (non-detached) transactions.
      Returns:
      whether deleted objects are allowed in normal transactions
    • getObjectTypes

      public Set<String> getObjectTypes()
      Get the object types this field is allowed to reference, if so restricted.
      Returns:
      names of allowed object types, or null if there is no restriction
    • visit

      public <R> R visit(FieldSwitch<R> target)
      Description copied from class: Field
      Apply visitor pattern.
      Overrides:
      visit in class SimpleField<ObjId>
      Type Parameters:
      R - visitor return type
      Parameters:
      target - target to invoke
      Returns:
      return value from the method of target corresponding to this instance's type
    • toString

      public String toString()
      Overrides:
      toString in class SimpleField<ObjId>
    • remapsObjectId

      protected boolean remapsObjectId()
      Overrides:
      remapsObjectId in class SimpleField<ObjId>
    • remapObjectId

      protected ObjId remapObjectId(ObjIdMap<ObjId> objectIdMap, ObjId srcId)
      Overrides:
      remapObjectId in class SimpleField<ObjId>