Akonadi::Server::RelationType

Akonadi::Server::RelationType Class Reference

#include <entities.h>

Inherits Entity.

Public Types

typedef QVector< RelationTypeList
 

Public Member Functions

 RelationType (const QString &name)
 
 RelationType (qint64 id, const QString &name)
 
 RelationType (const RelationType &other)
 
QString name () const
 
RelationTypeoperator= (const RelationType &other)
 
bool operator== (const RelationType &other) const
 
void setName (const QString &name)
 

Static Public Member Functions

static QStringList columnNames ()
 
static int count (const QString &column, const QVariant &value)
 
static bool exists (qint64 id)
 
static QVector< RelationTypeextractResult (QSqlQuery &query)
 
static QStringList fullColumnNames ()
 
static QString idColumn ()
 
static QString idFullColumnName ()
 
static QString nameColumn ()
 
static QString nameFullColumnName ()
 
static QString tableName ()
 

exists.

Checks if a record with name

bool insert (qint64 *insertId=nullptr)
 
bool hasPendingChanges () const
 
bool update ()
 
bool remove ()
 
void invalidateCache () const
 
static bool exists (const QString &name)
 
static RelationType retrieveById (qint64 id)
 
static RelationType retrieveByName (const QString &name)
 
static RelationType retrieveByNameOrCreate (const QString &name)
 
static RelationType::List retrieveAll ()
 
static RelationType::List retrieveFiltered (const QString &key, const QVariant &value)
 
static bool remove (qint64 id)
 
static void invalidateCompleteCache ()
 
static void enableCache (bool enable)
 
static bool remove (const QString &column, const QVariant &value)
 

Detailed Description

Representation of a record in the RelationType table.

This class is implicitly shared.

Definition at line 3309 of file entities.h.

Member Typedef Documentation

List of RelationType records.

Definition at line 3315 of file entities.h.

Member Function Documentation

QStringList RelationType::columnNames ( )
static

Returns a list of all SQL column names.

The names are in the correct order for usage with extractResult().

Definition at line 10086 of file entities.cpp.

int RelationType::count ( const QString column,
const QVariant value 
)
static

Count records with value value in column column.

Definition at line 10134 of file entities.cpp.

void RelationType::enableCache ( bool  enable)
static

Enable/disable caching for this table.

This method is not thread-safe, call before activating multi-threading.

Definition at line 10499 of file entities.cpp.

bool RelationType::exists ( qint64  id)
static

Checks if a record with id id exists.

Definition at line 10141 of file entities.cpp.

QVector< RelationType > RelationType::extractResult ( QSqlQuery query)
static

Extracts the query result.

Parameters
queryA executed query containing a list of RelationType records. Note that the fields need to be in the correct order (same as in the constructor)!

Definition at line 10166 of file entities.cpp.

QStringList RelationType::fullColumnNames ( )
static

Returns a list of all SQL column names prefixed with their tables names.

The names are in the correct order for usage with extractResult().

Definition at line 10096 of file entities.cpp.

bool RelationType::hasPendingChanges ( ) const

Returns true if this record has any pending changes.

Definition at line 10417 of file entities.cpp.

bool RelationType::insert ( qint64 *  insertId = nullptr)

Inserts this record into the DataStore.

Parameters
insertIdpointer to an int, filled with the identifier of this record on success.

Definition at line 10388 of file entities.cpp.

void RelationType::invalidateCache ( ) const

Invalidates the cache entry for this record.

This method has no effect if caching is not enabled for this table.

Definition at line 10475 of file entities.cpp.

void RelationType::invalidateCompleteCache ( )
static

Invalidates all cache entries for this table.

This method has no effect if caching is not enabled for this table.

Definition at line 10487 of file entities.cpp.

QString RelationType::name ( ) const

Returns the value of the name column of this record.

Definition at line 10064 of file entities.cpp.

RelationType & RelationType::operator= ( const RelationType other)

assignment operator

Definition at line 10048 of file entities.cpp.

bool RelationType::operator== ( const RelationType other) const

comparisson operator, compares ids, not content

Definition at line 10058 of file entities.cpp.

bool RelationType::remove ( )

Deletes this record.

Definition at line 10462 of file entities.cpp.

bool RelationType::remove ( qint64  id)
static

Deletes the record with the given id.

Definition at line 10468 of file entities.cpp.

QVector< RelationType > RelationType::retrieveAll ( )
static

Retrieve all records from this table.

Definition at line 10323 of file entities.cpp.

RelationType RelationType::retrieveById ( qint64  id)
static

Returns the record with id id.

Definition at line 10188 of file entities.cpp.

RelationType RelationType::retrieveByName ( const QString name)
static

Returns the record with name name.

Definition at line 10245 of file entities.cpp.

RelationType RelationType::retrieveByNameOrCreate ( const QString name)
static

Returns the record with name name.

If such record does not exist, it will be created. This method is thread-safe, so if multiple callers call it on non-existent name, only one will create the new record, others will wait and read it from the cache.

Definition at line 10302 of file entities.cpp.

QVector< RelationType > RelationType::retrieveFiltered ( const QString key,
const QVariant value 
)
static

Retrieve all records with value value in column key.

Definition at line 10340 of file entities.cpp.

void RelationType::setName ( const QString name)

Sets the value of the name column of this record.

Definition at line 10070 of file entities.cpp.

QString RelationType::tableName ( )
static

Returns the name of the SQL table.

Definition at line 10080 of file entities.cpp.

bool RelationType::update ( )

Stores all changes made to this record into the database.

Note that this method assumes the existence of an 'id' column to identify the record to update. If that column does not exist, all records will be changed.

Returns
true on success, false otherwise.

Definition at line 10426 of file entities.cpp.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Tue May 26 2020 22:46:24 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.