Akonadi

selectquerybuilder.h
1 /*
2  SPDX-FileCopyrightText: 2007 Volker Krause <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6 
7 #ifndef AKONADI_SELECTQUERYBUILDER_H
8 #define AKONADI_SELECTQUERYBUILDER_H
9 
10 #include "storage/querybuilder.h"
11 
12 namespace Akonadi
13 {
14 namespace Server
15 {
16 
20 template <typename T> class SelectQueryBuilder : public QueryBuilder
21 {
22 public:
27  : QueryBuilder(T::tableName(), Select)
28  {
29  addColumns(T::fullColumnNames());
30  }
31 
36  {
37  return T::extractResult(query());
38  }
39 };
40 
41 } // namespace Server
42 } // namespace Akonadi
43 
44 #endif
QSqlQuery & query()
Returns the query, only valid after exec().
QVector< T > result()
Returns the result of this SELECT query.
SelectQueryBuilder()
Creates a new query builder.
Helper class for creating and executing database SELECT queries.
Definition: item.h:31
Helper integration between Akonadi and Qt.
void addColumns(const QStringList &cols)
Adds the given columns to a select query.
Helper class to construct arbitrary SQL queries.
Definition: querybuilder.h:32
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Tue Jul 14 2020 23:16:39 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.