PropertyEdgeDelegate

class PropertyEdgeDelegate<T : Node, S : Node>(val edge: KProperty1<S, List<PropertyEdge<T>>>, val outgoing: Boolean = true)

This class can be used to implement delegated properties in Node classes. The most common use case is to have a property that is a list of PropertyEdge objects (for persistence) and a second (delegated) property that allows easy access just to the connected nodes of the individual edges for in-memory access.

For example:

class MyNode {
@Relationship(value = "EXPRESSIONS", direction = "OUTGOING")
@field:SubGraph("AST")
var expressionsEdges = mutableListOf<PropertyEdge<Expression>>()
var expressions by PropertyEdgeDelegate(MyNode::expressionsEdges)
}

This class is intentionally marked with Transient, so that the delegated properties are not transferred to the Neo4J OGM. Only the property that contains the property edges should be persisted in the graph database.

Constructors

Link copied to clipboard
fun <T : Node, S : Node> PropertyEdgeDelegate(edge: KProperty1<S, List<PropertyEdge<T>>>, outgoing: Boolean = true)

Functions

Link copied to clipboard
operator fun getValue(thisRef: S, property: KProperty<*>): List<T>
Link copied to clipboard
operator fun setValue(thisRef: S, property: KProperty<*>, value: List<T>)

Properties

Link copied to clipboard
Link copied to clipboard
val outgoing: Boolean = true