@AdditionalFilter(beanName = "idIdFilter")
abstract class Node

Base class for all Nodes This is always added to the schema All domain entities which can be retrieved via the api and should be persisted in the database should inherit from this class Two nodes are equal iff they have the same id, or, if no id is present yet on both, if they are the same object.

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard
internal var fieldCache: MutableMap<String, Any?>

Cached fetched values for fields Key is the path to the resultKey If entry is not found, it has not been fetched yet

Link copied to clipboard
val graphQLId: ID

The id of the node as seen in the GraphQL API

Link copied to clipboard
@Id
@GeneratedValue(generatorRef = "nodeIdGenerator")
internal var id: String?

Id of this node, null if not persisted in the database yet

Link copied to clipboard

True if this node is persisted in the database

Link copied to clipboard
internal var isSaved: Boolean

Flag to indicate if this node has been saved in the database If true, this node must not be saved again

Link copied to clipboard

Context necessary for lazy-loading

Link copied to clipboard
internal var orderFields: MutableMap<String, Any?>?

Order fields for sorting and cursor generation fetched from the database

Link copied to clipboard

Lookup for all node properties Trades memory (additional HashMap) for a cleaner and more extensible way to lookup the delegates (compared to reflection) Name of property as key

Link copied to clipboard

Readonly wrapper for the id If null, the node has not been persisted in the database yet

Functions

Link copied to clipboard
operator override fun equals(other: Any?): Boolean
Link copied to clipboard
internal suspend fun getFromGraphQL(@Autowired nodeQueryParser: NodeQueryParser, dataFetchingEnvironment: DataFetchingEnvironment): Any?

Gets the result of a GraphQL query Uses the cache to obtain the result, and if no cache entry was found, creates a new database query and executes it

Link copied to clipboard
internal fun <T : PropertyDelegate<*>> getProperty(property: KProperty1<*, *>): T

Gets a node property from the lookup May be changed in future to support extensibility

Link copied to clipboard
override fun hashCode(): Int
Link copied to clipboard
internal suspend fun <T : Node?> loadNodesOfRelationship(property: KProperty1<*, *>, loader: LazyLoadingSubqueryGenerator<T>.() -> Unit?)

Loads all nodes of a relationship If the loader is provided, specified nested nodes are loaded too

Link copied to clipboard

Creates a new node property used for one sides

Link copied to clipboard

Creates a new node property used for many sides

Link copied to clipboard
internal fun registerQueryResult(entry: NodeQueryEntry<*>, queryResult: Any?)

Registers the result of a query Used to cache the result of a query

Link copied to clipboard
open override fun toString(): String