Heart 1.4.918.d927d9c
Heart is base back end library for your c++ Qt projects.
Loading...
Searching...
No Matches
getsinglevalue.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2018-2025 QuasarApp.
3 * Distributed under the lgplv3 software license, see the accompanying
4 * Everyone is permitted to copy and distribute verbatim copies
5 * of this license document, but changing it is not allowed.
6*/
7
8#ifndef GETSINGLEVALUE_H
9#define GETSINGLEVALUE_H
10
11#include "dbobject.h"
12
13
14namespace QH {
15
16
17namespace PKG {
18
39class HEARTSHARED_EXPORT GetSingleValue final: public DBObject
40{
41
42public:
49 GetSingleValue(const DbAddress& address, const QString& field, const QString& primaryKey = "id");
50
55 QVariant value() const;
56
57 DBObject *createDBObject() const override;
58 PrepareResult prepareSelectQuery(QSqlQuery &q) const override;
59 bool fromSqlRecord(const QSqlRecord &q) override;
60 bool isCached() const override;
61 QString table() const override;
62
63protected:
64 QString primaryKey() const override;
65 QVariant primaryValue() const override;
66private:
67 QString _primaryKey;
68 QVariant _primaryValue;
69 QString _table;
70 QVariant _value;
71 QString _field;
72
73};
74}
75}
76#endif // GETSINGLEVALUE_H
The DbAddress class use to work with database addresses. Database Address it is structure with 2 valu...
Definition dbaddress.h:24
GetSingleValue(const DbAddress &address, const QString &field, const QString &primaryKey="id")
GetSingleValue This is default constructor of the GetMaxIntegerId class.
QString table() const override
table This method should be return name of the database table that should be contains objects with th...
bool isCached() const override
isCached This method sholud be return status of object. If this method return true then this object c...
QVariant primaryValue() const override
primaryValue This method is wraper of DBAddress::id. If This object do not contains a id value then r...
DBObject * createDBObject() const override
createDBObject This method should be create a object with the some type as the object called this met...
QVariant value() const
value This method return Maximum value of a sql tables field.
bool fromSqlRecord(const QSqlRecord &q) override
fromSqlRecord This method should be initialize this object from the executed sqlRecord....
PrepareResult prepareSelectQuery(QSqlQuery &q) const override
prepareSelectQuery This method should be prepare a query for selected data. Override this method for ...
QString primaryKey() const override
primaryKey This method must be return the name of primary key of this object table....
The PKG namesapce - this namespace contains all default packages of the Heart library....
Definition heart.h:211
PrepareResult
The PrepareResult enum is result of work prepare sql query of dbobjects.
Definition dbobject.h:24
The QH namespace - QuasarApp Heart namespace. This namespace contains all classes of the Heart librar...
Definition heart.cpp:13