Heart 1.3.842.34c2ab5
Heart is base back end library for your c++ Qt projects.
setsinglevalue.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 SETSINGLEVALUE_H
9#define SETSINGLEVALUE_H
10
11#include "dbobject.h"
12
13namespace QH {
14
15
16namespace PKG {
17
34{
35public:
43 SetSingleValue(const DbAddress& address,
44 const QString& field,
45 const QVariant& value,
46 const QString& primaryKey = "id");
47
48 DBObject *createDBObject() const override;
49 PrepareResult prepareUpdateQuery(QSqlQuery &q) const override;
50 PrepareResult prepareInsertQuery(QSqlQuery &q, bool replace) const override;
51
52 bool fromSqlRecord(const QSqlRecord &q) override;
53 bool isCached() const override;
54
55 QString table() const override;
56
57
58protected:
59 QString primaryKey() const override;
60 QVariant primaryValue() const override;
61
62private:
63 QString _primaryKey;
64 QVariant _primaryValue;
65 QString _table;
66 QVariant _value;
67 QString _field;
68};
69
70}
71}
72#endif // SETSINGLEVALUE_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 SetSingleValue class This is simple class - request sets a single value into database.
#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