FOSSredder 0.5.0
Loading...
Searching...
No Matches
SqliteStatementDraftRepository Class Reference

#include <SqliteStatementDraftRepository.h>

Inheritance diagram for SqliteStatementDraftRepository:
Collaboration diagram for SqliteStatementDraftRepository:

Classes

struct  Impl

Public Member Functions

 SqliteStatementDraftRepository (const std::string &dbPath)
 Create a statement draft repository for the database at the given path.
 SqliteStatementDraftRepository (std::shared_ptr< SqliteDb > db)
 Create a statement draft repository using an existing database handle wrapper.
 ~SqliteStatementDraftRepository () override
 Destroy the repository.
void addStatementDraft (const std::shared_ptr< core::application::importing::draft::StatementDraft > &draft) override
 Insert a new statement draft.
std::vector< std::shared_ptr< core::application::importing::draft::StatementDraft > > getStatementDrafts () const override
 Retrieve all statement drafts.
std::optional< std::shared_ptr< core::application::importing::draft::StatementDraft > > getStatementDraftById (const std::string &id) const override
 Retrieve a statement draft by identifier.
void removeStatementDraft (const std::string &id) override
 Remove a statement draft by identifier.
void updateStatementDraft (const std::shared_ptr< core::application::importing::draft::StatementDraft > &draft) override
 Update an existing statement draft.
void upsertStatementDraft (const std::shared_ptr< core::application::importing::draft::StatementDraft > &draft) override
 Insert or update a statement draft.
void clearStatementDrafts () override
 Remove all statement drafts.
Public Member Functions inherited from core::ports::repositories::IStatementDraftRepository
virtual ~IStatementDraftRepository ()=default
 Destroy the statement draft repository interface.
void saveStatementDraft (const std::shared_ptr< core::application::importing::draft::StatementDraft > &draft)
 Replace the stored statement draft with the provided draft.
std::optional< std::shared_ptr< core::application::importing::draft::StatementDraft > > getStatementDraft () const
 Retrieve the first stored statement draft, if any.
void clearStatementDraft ()
 Remove the stored statement draft.

Detailed Description

Definition at line 16 of file SqliteStatementDraftRepository.h.

Constructor & Destructor Documentation

◆ SqliteStatementDraftRepository() [1/2]

SqliteStatementDraftRepository::SqliteStatementDraftRepository ( const std::string & dbPath)
explicit

Create a statement draft repository for the database at the given path.

Parameters
dbPathSQLite database path.

Definition at line 111 of file SqliteStatementDraftRepository.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SqliteStatementDraftRepository() [2/2]

SqliteStatementDraftRepository::SqliteStatementDraftRepository ( std::shared_ptr< SqliteDb > db)
explicit

Create a statement draft repository using an existing database handle wrapper.

Parameters
dbShared SQLite database wrapper.

Definition at line 115 of file SqliteStatementDraftRepository.cpp.

◆ ~SqliteStatementDraftRepository()

SqliteStatementDraftRepository::~SqliteStatementDraftRepository ( )
overridedefault

Destroy the repository.

Member Function Documentation

◆ addStatementDraft()

void SqliteStatementDraftRepository::addStatementDraft ( const std::shared_ptr< core::application::importing::draft::StatementDraft > & draft)
overridevirtual

Insert a new statement draft.

Parameters
draftStatement draft to add.

Implements core::ports::repositories::IStatementDraftRepository.

Definition at line 125 of file SqliteStatementDraftRepository.cpp.

◆ clearStatementDrafts()

void SqliteStatementDraftRepository::clearStatementDrafts ( )
overridevirtual

Remove all statement drafts.

Implements core::ports::repositories::IStatementDraftRepository.

Definition at line 227 of file SqliteStatementDraftRepository.cpp.

Here is the call graph for this function:

◆ getStatementDraftById()

std::optional< std::shared_ptr< core::application::importing::draft::StatementDraft > > SqliteStatementDraftRepository::getStatementDraftById ( const std::string & id) const
overridevirtual

Retrieve a statement draft by identifier.

Parameters
idStatement draft identifier.
Returns
Statement draft with the requested identifier, if found.

Implements core::ports::repositories::IStatementDraftRepository.

Definition at line 167 of file SqliteStatementDraftRepository.cpp.

Here is the call graph for this function:

◆ getStatementDrafts()

std::vector< std::shared_ptr< core::application::importing::draft::StatementDraft > > SqliteStatementDraftRepository::getStatementDrafts ( ) const
overridevirtual

Retrieve all statement drafts.

Returns
All stored statement drafts.

Implements core::ports::repositories::IStatementDraftRepository.

Definition at line 139 of file SqliteStatementDraftRepository.cpp.

Here is the call graph for this function:

◆ removeStatementDraft()

void SqliteStatementDraftRepository::removeStatementDraft ( const std::string & id)
overridevirtual

Remove a statement draft by identifier.

Parameters
idStatement draft identifier.

Implements core::ports::repositories::IStatementDraftRepository.

Definition at line 192 of file SqliteStatementDraftRepository.cpp.

Here is the call graph for this function:

◆ updateStatementDraft()

void SqliteStatementDraftRepository::updateStatementDraft ( const std::shared_ptr< core::application::importing::draft::StatementDraft > & draft)
overridevirtual

Update an existing statement draft.

Parameters
draftStatement draft to update.

Implements core::ports::repositories::IStatementDraftRepository.

Definition at line 203 of file SqliteStatementDraftRepository.cpp.

◆ upsertStatementDraft()

void SqliteStatementDraftRepository::upsertStatementDraft ( const std::shared_ptr< core::application::importing::draft::StatementDraft > & draft)
overridevirtual

Insert or update a statement draft.

Parameters
draftStatement draft to upsert.

Implements core::ports::repositories::IStatementDraftRepository.

Definition at line 215 of file SqliteStatementDraftRepository.cpp.


The documentation for this class was generated from the following files: