Property for the many side of a relation Is mapped to a Connection in GraphQL

Parameters

Constructors

Link copied to clipboard
constructor(parent: Node, property: KProperty1<*, *>)

Types

Link copied to clipboard

Node property representing the many side of a node relation. Provides set functionality. The iterator supports remove.

Properties

Link copied to clipboard
private val addedNodes: HashSet<T>

Newly added nodes, relations must be added to the database

Link copied to clipboard
private var currentNodes: MutableSet<T>?

Current set of nodes

Link copied to clipboard
private val isLoaded: Boolean

true iff the current values are loaded from the database or set via constructor

Link copied to clipboard

Delegate for lazy-loading the property

Link copied to clipboard
protected var nodeCache: NodeCache?

NodeCache used to load this property might be set after initial loading, but must not be changed

Link copied to clipboard
Link copied to clipboard
protected val parent: Node
Link copied to clipboard
protected val property: KProperty1<*, *>
Link copied to clipboard
protected val propertyName: String

Dynamic type of parent and name of property, can be used for error messages without leaking information

Link copied to clipboard
private val removedNodes: HashSet<T>

Newly removed nodes, relations must be removed from the database

Functions

Link copied to clipboard
private suspend fun ensureLoaded(cache: NodeCache?, loader: LazyLoadingSubqueryGenerator<T>.() -> Unit?)

Ensures that this NodeSetProperty is loaded

Link copied to clipboard
internal open suspend override fun getLoadedProperty(cache: NodeCache?, loader: LazyLoadingSubqueryGenerator<T>.() -> Unit?): NodeSetPropertyDelegate.NodeSetProperty

Gets the loaded property which is returned by the lazy loading delegate

Link copied to clipboard
internal open override fun getLoadedRelatedNodes(): Collection<Node>

Gets related nodes defined by this property, but only those already loaded (therefore no lazy loading) The relationships do not have to be persisted yet

Link copied to clipboard
internal open override fun getRelatedNodesToSave(): Collection<Node>

Gets Nodes which should be persisted when this Node is persisted

Link copied to clipboard
internal open override fun getRelationshipDiff(): RelationshipDiff

Gets the diff of added and removed relationships to persist in the database

Link copied to clipboard

Gets the lazy loading delegate which is used to get the value of the property

Link copied to clipboard
open override fun registerQueryResult(fieldDefinition: FieldDefinition, queryResult: NodeQueryResult<T>)

Called to register a database query result Adds the result to the cache Can be overridden to add custom behavior (super should be called in this case)

Link copied to clipboard
open override fun validate(savingNodes: Set<Node>, relationshipDefinition: RelationshipDefinition, nodeDefinitionCollection: NodeDefinitionCollection)

Called to validate the property Should throw an exception if the property is invalid, with an appropriate reason