Heart 1.3.842.34c2ab5
Heart is base back end library for your c++ Qt projects.
getsinglevalue.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2018-2024 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
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
The DBObject class- main class for work with data base.
Definition dbobject.h:94
The GetSingleValue class is intended for get a single value from database. The value is selected by p...
#define HEARTSHARED_EXPORT
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