jetleaf_data library

πŸ—„ JetLeaf Data Library

Provides repository and data access abstractions for JetLeaf applications, including CRUD operations, paging, sorting, and repository lifecycle management.

This library supports annotation-driven repository definitions, event handling, and automatic configuration for standard data access patterns.

πŸ”‘ Core Components

πŸ› Repository Context

  • abstract_repository_context.dart β€” base abstraction for a repository execution context
  • default_repository_context.dart β€” default implementation of repository context
  • repository_application_module.dart β€” application-level module configuration for repositories
  • repository_context.dart β€” main repository context interface
  • repository_context_aware.dart β€” mixin for repository context awareness in objects
  • repository_definition.dart β€” metadata and definition of repository interfaces
  • repository_method_interceptor.dart β€” method interception for repository calls

⚑ Event Handling

  • repository_event.dart β€” base class for repository lifecycle events, such as entity creation, update, deletion

πŸ“„ Paging & Sorting

Supports paginated and sorted queries across repositories:

  • abstract_page_request.dart β€” base interface for page requests
  • page_request.dart β€” concrete page request
  • page.dart β€” represents a paged result
  • slice.dart, sliced_chunk.dart β€” partial result sets
  • scroll_position.dart β€” track pagination scroll positions
  • limit.dart β€” page size constraints
  • pageable.dart β€” abstraction for pageable queries
  • sort.dart β€” sorting metadata
  • unpaged.dart β€” sentinel object representing no pagination

πŸ“š Repository Interfaces

  • crud_repository.dart β€” standard CRUD operations
  • list_crud_repository.dart β€” list-based CRUD repository
  • paging_and_sort_repository.dart β€” repository supporting paging and sorting
  • repository_executor.dart β€” executor for repository operations

βš™ Auto-Configuration

  • data_auto_configuration.dart β€” sets up default repository context, repository scanning, and repository lifecycle handling

🎯 Intended Usage

Import this library to implement data repositories in a JetLeaf project:

import 'package:jetleaf_data/jetleaf_data.dart';

class UserRepository extends CrudRepository<User, String> {
  // CRUD operations are automatically available
}

final repositoryContext = DefaultRepositoryContext();

Provides a standard foundation for repository-based data access, paging, sorting, and event-driven repository monitoring.

Β© 2025 Hapnium & JetLeaf Contributors

Classes

AbstractPageRequest
Base class for paged requests that define page number and page size.
AbstractRepositoryContext
An abstract base implementation of a repository context that stores and provides metadata (RepositoryDefinition) for repository methods.
ConfigurableRepositoryContext
A configurable variant of RepositoryContext that allows dynamic registration of RepositoryDefinitions and setting of the RepositoryExecutor.
CrudRepository<T, ID>
A generic CRUD repository interface extending Repository, providing standard create, read, update, and delete operations for entities of type T identified by ID.
DataAutoConfiguration
Auto-configuration pod for Jetleaf Data module.
DataRepositoryDefinition
A concrete implementation of RepositoryDefinition that stores metadata about a repository method, including its type, reflection metadata, and whether it should be treated as an internal framework method.
DefaultRepositoryContext
The default runtime implementation of RepositoryContext, responsible for discovering repository classes, building repository method definitions, and providing the active RepositoryExecutor for repository operations.
InterceptedRepositoryMethodEvent<T>
Event triggered when a repository method is intercepted by Jetleaf’s method interception system.
KeysetScrollPosition
Represents a key-set (cursor-based) scroll position in a collection.
Limit
A value object representing an upper bound (limit) typically used in pagination, query constraints, or result-size restrictions.
Limiting
Marker mixin indicating that a type provides limiting behavior.
ListCrudRepository<T, ID>
A generic list-based CRUD repository extending CrudRepository, ensuring that all multi-entity operations return List instead of general Iterable.
ListPagingAndSortRepository<T, ID>
A generic list-based paging and sorting repository, extending PagingAndSortRepository and ensuring that sorted results are returned as List instead of a generic Iterable.
OffsetScrollPosition
Represents an offset-based scroll position, commonly used for index-based pagination (e.g., SQL LIMIT/OFFSET, list slicing, sequential pagination).
Page<T>
Represents a full page of data in a paginated dataset.
Pageable
Represents a pagination request describing which slice of data should be retrieved from a paged resource.
PageRequest
Represents a concrete, paged request with page number, page size, and optional Sort.
PagingAndSortRepository<T, ID>
A generic repository with paging and sorting capabilities, extending Repository and providing methods to retrieve sorted collections or paginated results.
RepositoryApplicationModule
An application module that registers repository-related infrastructure into the Jetleaf runtime by adding a RepositoryAwareProcessor to the ApplicationContext.
RepositoryAwareProcessor
A PodInitializationProcessor that automatically wires repository-related infrastructure into pods during the initialization phase.
RepositoryContext
A context interface for managing Repository definitions and providing an RepositoryExecutor for repository operations.
RepositoryContextAware
Indicates that a class is aware of and can receive a RepositoryContext.
RepositoryDefinition
Defines the metadata and characteristics of a repository method.
RepositoryEvent
Base event class for repository-related application events.
RepositoryExecutor
An abstract executor for performing CRUD and query operations on Repository instances in a uniform, asynchronous manner.
RepositoryMethodInterceptor
A method interceptor for repository classes annotated with Repository.
ScrollPosition
Represents a position in a scrollable or paginated collection.
SimplePage<T>
Concrete implementation of Page<T> representing a page of elements with an optional total element count.
Slice<T>
Represents a slice of a paginated dataset, containing a subset of items along with metadata about pagination and sorting.
SlicedChunk<T>
Concrete implementation of Slice<T> backed by a Pageable and a stream of elements.
Sort
Represents an ordered collection of sorting instructions, each expressed as a SortOrder.
SortOrder
Represents a single sorting instruction consisting of:
Unpaged
Represents an unpaged pagination request, i.e., a sentinel object indicating that no pagination boundaries should be applied.

Enums

RepositoryType
Represents the different repository implementation categories used in Jetleaf's repository architecture.
ScrollDirection
Represents the direction of a scrolling action, such as navigating through paginated results, lists, or timeline-like structures.
SortDirection
Represents the direction in which results should be sorted.