Heart
1.4.918.d927d9c
Heart is base back end library for your c++ Qt projects.
Toggle main menu visibility
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
14
namespace
QH
{
15
16
17
namespace
PKG
{
18
39
class
HEARTSHARED_EXPORT
GetSingleValue
final:
public
DBObject
40
{
41
42
public
:
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
63
protected
:
64
QString
primaryKey
()
const override
;
65
QVariant
primaryValue
()
const override
;
66
private
:
67
QString _primaryKey;
68
QVariant _primaryValue;
69
QString _table;
70
QVariant _value;
71
QString _field;
72
73
};
74
}
75
}
76
#endif
// GETSINGLEVALUE_H
QH::DbAddress
The DbAddress class use to work with database addresses. Database Address it is structure with 2 valu...
Definition
dbaddress.h:24
QH::PKG::DBObject::DBObject
DBObject()
Definition
dbobject.cpp:22
QH::PKG::GetSingleValue::GetSingleValue
GetSingleValue(const DbAddress &address, const QString &field, const QString &primaryKey="id")
GetSingleValue This is default constructor of the GetMaxIntegerId class.
Definition
getsinglevalue.cpp:17
QH::PKG::GetSingleValue::table
QString table() const override
table This method should be return name of the database table that should be contains objects with th...
Definition
getsinglevalue.cpp:58
QH::PKG::GetSingleValue::isCached
bool isCached() const override
isCached This method sholud be return status of object. If this method return true then this object c...
Definition
getsinglevalue.cpp:54
QH::PKG::GetSingleValue::primaryValue
QVariant primaryValue() const override
primaryValue This method is wraper of DBAddress::id. If This object do not contains a id value then r...
Definition
getsinglevalue.cpp:66
QH::PKG::GetSingleValue::createDBObject
DBObject * createDBObject() const override
createDBObject This method should be create a object with the some type as the object called this met...
Definition
getsinglevalue.cpp:31
QH::PKG::GetSingleValue::value
QVariant value() const
value This method return Maximum value of a sql tables field.
Definition
getsinglevalue.cpp:27
QH::PKG::GetSingleValue::fromSqlRecord
bool fromSqlRecord(const QSqlRecord &q) override
fromSqlRecord This method should be initialize this object from the executed sqlRecord....
Definition
getsinglevalue.cpp:48
QH::PKG::GetSingleValue::prepareSelectQuery
PrepareResult prepareSelectQuery(QSqlQuery &q) const override
prepareSelectQuery This method should be prepare a query for selected data. Override this method for ...
Definition
getsinglevalue.cpp:35
QH::PKG::GetSingleValue::primaryKey
QString primaryKey() const override
primaryKey This method must be return the name of primary key of this object table....
Definition
getsinglevalue.cpp:62
dbobject.h
QH::PKG
The PKG namesapce - this namespace contains all default packages of the Heart library....
Definition
heart.h:211
QH::PKG::PrepareResult
PrepareResult
The PrepareResult enum is result of work prepare sql query of dbobjects.
Definition
dbobject.h:24
QH
The QH namespace - QuasarApp Heart namespace. This namespace contains all classes of the Heart librar...
Definition
heart.cpp:13
src
public
packages
getsinglevalue.h
Generated by
1.18.0