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 contextdefault_repository_context.dartβ default implementation of repository contextrepository_application_module.dartβ application-level module configuration for repositoriesrepository_context.dartβ main repository context interfacerepository_context_aware.dartβ mixin for repository context awareness in objectsrepository_definition.dartβ metadata and definition of repository interfacesrepository_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 requestspage_request.dartβ concrete page requestpage.dartβ represents a paged resultslice.dart,sliced_chunk.dartβ partial result setsscroll_position.dartβ track pagination scroll positionslimit.dartβ page size constraintspageable.dartβ abstraction for pageable queriessort.dartβ sorting metadataunpaged.dartβ sentinel object representing no pagination
π Repository Interfaces
crud_repository.dartβ standard CRUD operationslist_crud_repository.dartβ list-based CRUD repositorypaging_and_sort_repository.dartβ repository supporting paging and sortingrepository_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
Tidentified byID. - 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
PodInitializationProcessorthat 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.