Akonadi::Server::Entity

Search for usage in LXR

#include <entity.h>

Public Types

using Id = qint64
 
enum  RelationSide { Left, Right }
 

Static Public Member Functions

template<typename T >
static bool addToRelation (qint64 leftId, qint64 rightId)
 
template<typename T >
static bool clearRelation (qint64 id, RelationSide side=Left)
 
template<typename T >
static int count (const QString &column, const QVariant &value)
 
template<typename T >
static QString joinByName (const QVector< T > &list, const QString &sep)
 
template<typename T >
static bool relatesTo (qint64 leftId, qint64 rightId)
 
template<typename T >
static bool remove (const QString &column, const QVariant &value)
 
template<typename T >
static bool removeFromRelation (qint64 leftId, qint64 rightId)
 

Protected Member Functions

 Entity (qint64 id)
 
qint64 id () const
 
bool isValid () const
 
void setId (qint64 id)
 

Detailed Description

Base class for classes representing database records.

It also contains low-level data access and manipulation template methods.

Definition at line 23 of file entity.h.

Member Function Documentation

◆ addToRelation()

template<typename T >
static bool Akonadi::Server::Entity::addToRelation ( qint64  leftId,
qint64  rightId 
)
inlinestatic

Adds an entry to a n:m relation table (specified by the template parameter).

Parameters
leftIdIdentifier of the left part of the relation.
rightIdIdentifier of the right part of the relation.

Definition at line 78 of file entity.h.

◆ clearRelation()

template<typename T >
static bool Akonadi::Server::Entity::clearRelation ( qint64  id,
RelationSide  side = Left 
)
inlinestatic

Clears all entries from a n:m relation table (specified by the given template parameter).

Parameters
idIdentifier on the relation side.
sideThe side of the relation.

Definition at line 103 of file entity.h.

◆ count()

template<typename T >
static int Akonadi::Server::Entity::count ( const QString column,
const QVariant value 
)
inlinestatic

Returns the number of records having value in column.

Parameters
columnThe name of the key column.
valueThe value used to identify the record.

Definition at line 50 of file entity.h.

◆ relatesTo()

template<typename T >
static bool Akonadi::Server::Entity::relatesTo ( qint64  leftId,
qint64  rightId 
)
inlinestatic

Checks whether an entry in a n:m relation table exists.

Parameters
leftIdIdentifier of the left part of the relation.
rightIdIdentifier of the right part of the relation.

Definition at line 68 of file entity.h.

◆ remove()

template<typename T >
static bool Akonadi::Server::Entity::remove ( const QString column,
const QVariant value 
)
inlinestatic

Deletes all records having value in column.

Definition at line 58 of file entity.h.

◆ removeFromRelation()

template<typename T >
static bool Akonadi::Server::Entity::removeFromRelation ( qint64  leftId,
qint64  rightId 
)
inlinestatic

Removes an entry from a n:m relation table (specified by the template parameter).

Parameters
leftIdIdentifier of the left part of the relation.
rightIdIdentifier of the right part of the relation.

Definition at line 88 of file entity.h.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Fri Aug 12 2022 04:00:09 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.