db
Last updated
Last updated
Last updated: 2025-06-06 01:05:25.984715 File source:
This package defines the local database functionality for the Device Management Service (DMS). It provides a generic repository pattern for database operations with a clover
implementation, which is a NoSQL
or document oriented database implementation.
The package uses generic interfaces to support different data types and provides query condition functions for building database queries.
Here is quick overview of the contents of this pacakge:
Various test files for ensuring functionality works as expected.
The class diagram for the db
package is shown below.
Source file
Rendered from source file
Key Interfaces
GenericRepository: Defines basic CRUD operations (Create, Read, Update, Delete) and standard querying methods using generic types, allowing it to be used with any data type.
GenericEntityRepository: Defines operations for repositories handling a single record, with methods for saving, retrieving, clearing, and tracking history.
Query Conditions
The package provides functions to create query conditions for database operations:
EQ
: Creates equality comparison (field = value)
GT
: Creates greater-than comparison (field > value)
GTE
: Creates greater-than-or-equal comparison (field >= value)
LT
: Creates less-than comparison (field < value)
LTE
: Creates less-than-or-equal comparison (field <= value)
IN
: Creates IN comparison (field IN values)
LIKE
: Creates LIKE comparison for pattern matching (field LIKE pattern)
: Current file which is aimed towards developers who wish to use and modify the package functionality.
: This folder contains the core interfaces and implementations for database operations.
: Defines the GenericRepository
interface with basic CRUD operations and standard querying methods using generic types.
: Defines the GenericEntityRepository
interface for repositories handling a single record.
: Contains query condition functions (EQ, GT, GTE, LT, LTE, IN, LIKE) for building database queries.
: Contains unit tests for the query condition functions.
: Contains utility functions for database operations.
: Contains unit tests for the utility functions.
: Defines error types for database operations.
: Contains the CloverDB (NoSQL) implementation of the repository interfaces.
: Implements the GenericRepository
interface for CloverDB.
: Implements the GenericEntityRepository
interface for CloverDB.
: Contains the CloverDB connection and initialization logic.
: This folder contains the class diagram of the package.
Refer to the file defined in the repositories folder for detailed specification of the package.