watchRelated<R extends DatumEntityInterface> method

Stream<List<R>>? watchRelated<R extends DatumEntityInterface>(
  1. T parent,
  2. String relationName
)

DEPRECATED: This method will be removed in a future version. Use the withRelated parameter in the query method for eager loading, or the fetch() method on the relation object for lazy loading. Reactively watches related entities for a given parent entity.

This method provides a stream of related entities that automatically updates when the underlying data changes.

  • parent: The entity instance for which to watch related data.
  • relationName: The name of the relation to watch.

Returns a Stream<List<R>> of the related entities, or null if the adapter does not support reactive queries. Throws an error if the relation is not defined.

Implementation

Stream<List<R>>? watchRelated<R extends DatumEntityInterface>(
  T parent,
  String relationName,
) {
  _ensureInitialized();
  return _relationLoader.watchRelated<R>(parent, relationName);
}