Package io.permazen
Class PermazenReferenceField
java.lang.Object
io.permazen.PermazenSchemaItem
io.permazen.PermazenField
io.permazen.PermazenSimpleField
io.permazen.PermazenReferenceField
Represents a reference field in a
PermazenClass
or a reference sub-field of a complex field in a PermazenClass
.-
Method Summary
Modifier and TypeMethodDescriptionGet aConverter
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.String[]
Get this field's forward copy/find cascades.String[]
Get this field's inverse copy/find cascades.Get the inverseDeleteAction
configured for this field.Set<PermazenClass<?>>
Get the database object types which this field is allowed to reference.Get the corresonding core API database instance.getValue
(PermazenObject pobj) Get the Java value of this field in the given Java model object.boolean
Determine whether this field allows assignment to deleted objects in normal transactions.boolean
Determine whether the referred-to object should be deleted when an object containing this field is deleted.<R> R
visit
(PermazenFieldSwitch<R> target) Apply visitor pattern.Methods inherited from class io.permazen.PermazenSimpleField
getDeclaringAnnotation, getEncoding, getFullName, getIndex, getParentField, getSetter, getTypeToken, isIndexed, isSubField, setValue
Methods inherited from class io.permazen.PermazenField
getGetter, getKey, getPermazenClass
Methods inherited from class io.permazen.PermazenSchemaItem
getName, getSchemaId, getStorageId, toString
-
Method Details
-
getValue
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 classPermazenSimpleField
- Parameters:
pobj
- object containing this field- Returns:
- this field's value in
pobj
-
visit
Description copied from class:PermazenField
Apply visitor pattern.- Overrides:
visit
in classPermazenSimpleField
- 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
Description copied from class:PermazenField
Get aConverter
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 classPermazenSimpleField
- Parameters:
ptx
- transaction- Returns:
Converter
from core API to Java, or null if no conversion is required
-
getInverseDelete
Get the inverseDeleteAction
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
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
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
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
Description copied from class:PermazenSchemaItem
Get the corresonding core API database instance.- Overrides:
getSchemaItem
in classPermazenSimpleField
- Returns:
- this instance's correpsonding
SchemaItem
-