![]() |
Banking_System_Server
1.0.0
Qt-based banking app for user/admin account management, transactions, secure server communication via PostgreSQL/Supabase.
|
The DbResult class represents a result set returned from a database query. More...
#include <dbresult.h>
Public Member Functions | |
DbResult () | |
Default constructor for DbResult. More... | |
DbResult (const QList< QVariant > &data) | |
Constructs a DbResult from a list of QVariant data. More... | |
bool | isEmpty () const |
Checks if the result set is empty. More... | |
QJsonObject | first () const |
Retrieves the first item in the result set. More... | |
int | size () const |
Gets the number of items in the result set. More... | |
QJsonObject | data (int pos) const |
Retrieves data at a specific position in the result set. More... | |
QJsonArray | data () const |
Gets all the data in the result set. More... | |
QString | toJsonString () const |
Converts the result set to a JSON string. More... | |
The DbResult class represents a result set returned from a database query.
This class encapsulates the data returned from a database operation and provides methods to access and manipulate the result. It stores the result in a JSON array format.
DbResult::DbResult | ( | const QList< QVariant > & | data | ) |
Constructs a DbResult from a list of QVariant data.
data | A QList<QVariant> containing data to be stored in the result. The data is converted into a JSON array of QJsonObjects. |
QJsonArray DbResult::data | ( | ) | const |
Gets all the data in the result set.
Referenced by DbResult(), and first().
QJsonObject DbResult::data | ( | int | pos | ) | const |
Retrieves data at a specific position in the result set.
pos | The index position of the item to retrieve. |
Referenced by GetDatabaseRequest::execute(), and GetTransactionsHistoryRequest::execute().
QJsonObject DbResult::first | ( | ) | const |
Retrieves the first item in the result set.
Referenced by CreateNewUserRequest::execute(), DeleteUserRequest::execute(), GetAccountNumberRequest::execute(), GetBalanceRequest::execute(), GetDatabaseRequest::execute(), GetTransactionsHistoryRequest::execute(), LoginRequest::execute(), MakeTransactionRequest::execute(), UpdateEmailRequest::execute(), UpdatePasswordRequest::execute(), UpdateUserRequest::execute(), and UserInitRequest::execute().
bool DbResult::isEmpty | ( | ) | const |
Checks if the result set is empty.
Referenced by data(), CreateNewUserRequest::execute(), DeleteUserRequest::execute(), GetAccountNumberRequest::execute(), GetBalanceRequest::execute(), GetDatabaseRequest::execute(), GetTransactionsHistoryRequest::execute(), LoginRequest::execute(), MakeTransactionRequest::execute(), UpdateEmailRequest::execute(), UpdatePasswordRequest::execute(), UpdateUserRequest::execute(), and UserInitRequest::execute().
int DbResult::size | ( | ) | const |
Gets the number of items in the result set.
Referenced by data(), GetDatabaseRequest::execute(), and GetTransactionsHistoryRequest::execute().
QString DbResult::toJsonString | ( | ) | const |
Converts the result set to a JSON string.