Package io.permazen

Class PermazenReferenceField


public class PermazenReferenceField extends PermazenSimpleField
Represents a reference field in a PermazenClass or a reference sub-field of a complex field in a PermazenClass.
  • Method Details

    • getValue

      public PermazenObject getValue(PermazenObject pobj)
      Description copied from class: PermazenField
      Get the Java value of this field in the given Java model object. Does not alter the schema of the object.
      Overrides:
      getValue in class PermazenSimpleField
      Parameters:
      pobj - object containing this field
      Returns:
      this field's value in pobj
    • visit

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

      public Converter<ObjId,PermazenObject> getConverter(PermazenTransaction ptx)
      Description copied from class: PermazenField
      Get a Converter that converts this field's value from what the core database returns to what the Java application expects, or null if no conversion is needed.
      Overrides:
      getConverter in class PermazenSimpleField
      Parameters:
      ptx - transaction
      Returns:
      Converter from core API to Java, or null if no conversion is required
    • getInverseDelete

      public DeleteAction getInverseDelete()
      Get the inverse DeleteAction configured for this field.
      Returns:
      this field's DeleteAction
    • isForwardDelete

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

      public boolean isAllowDeleted()
      Determine whether this field allows assignment to deleted objects in normal transactions.
      Returns:
      this field's deleted assignment setting for normal transactions
    • getForwardCascades

      public String[] getForwardCascades()
      Get this field's forward copy/find cascades.

      The returned array is a copy; modifications to it have no effect.

      Returns:
      zero or more forward copy cascade names
    • getInverseCascades

      public String[] getInverseCascades()
      Get this field's inverse copy/find cascades.

      The returned array is a copy; modifications to it have no effect.

      Returns:
      zero or more inverse copy cascade names
    • getObjectTypes

      public Set<PermazenClass<?>> getObjectTypes()
      Get the database object types which this field is allowed to reference.
      Returns:
      allowed object types to reference, or null if there is no restriction
    • getSchemaItem

      public ReferenceField getSchemaItem()
      Description copied from class: PermazenSchemaItem
      Get the corresonding core API database instance.
      Overrides:
      getSchemaItem in class PermazenSimpleField
      Returns:
      this instance's correpsonding SchemaItem