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 (DataStore *store, qint64 leftId, qint64 rightId)
 
template<typename T >
static bool addToRelation (qint64 leftId, qint64 rightId)
 
template<typename T >
static bool clearRelation (DataStore *store, qint64 id, RelationSide side=Left)
 
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 int count (DataStore *store, const QString &column, const QVariant &value)
 
template<typename T >
static QString joinByName (const QList< T > &list, const QString &sep)
 
template<typename T >
static bool relatesTo (DataStore *store, qint64 leftId, qint64 rightId)
 
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 remove (DataStore *store, const QString &column, const QVariant &value)
 
template<typename T >
static bool removeFromRelation (DataStore *store, qint64 leftId, qint64 rightId)
 
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 Typedef Documentation

◆ Id

using Akonadi::Server::Entity::Id = qint64

Definition at line 26 of file entity.h.

Member Enumeration Documentation

◆ RelationSide

enum Akonadi::Server::Entity::RelationSide

Definition at line 129 of file entity.h.

Constructor & Destructor Documentation

◆ Entity() [1/2]

Entity::Entity ( )
protected

Definition at line 16 of file entity.cpp.

◆ Entity() [2/2]

Entity::Entity ( qint64 id)
explicitprotected

Definition at line 21 of file entity.cpp.

◆ ~Entity()

Entity::~Entity ( )
protected

Definition at line 26 of file entity.cpp.

Member Function Documentation

◆ addToRelation() [1/2]

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

Definition at line 107 of file entity.h.

◆ addToRelation() [2/2]

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 101 of file entity.h.

◆ clearRelation() [1/2]

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

Definition at line 145 of file entity.h.

◆ clearRelation() [2/2]

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 140 of file entity.h.

◆ count() [1/2]

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 52 of file entity.h.

◆ count() [2/2]

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

Definition at line 58 of file entity.h.

◆ id()

qint64 Entity::id ( ) const
protected

Definition at line 35 of file entity.cpp.

◆ isValid()

bool Entity::isValid ( ) const
protected

Definition at line 45 of file entity.cpp.

◆ joinByName()

template<typename T >
static QString Akonadi::Server::Entity::joinByName ( const QList< T > & list,
const QString & sep )
inlinestatic

Definition at line 36 of file entity.h.

◆ relatesTo() [1/2]

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

Definition at line 90 of file entity.h.

◆ relatesTo() [2/2]

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 84 of file entity.h.

◆ remove() [1/2]

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 67 of file entity.h.

◆ remove() [2/2]

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

Definition at line 73 of file entity.h.

◆ removeFromRelation() [1/2]

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

Definition at line 124 of file entity.h.

◆ removeFromRelation() [2/2]

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 118 of file entity.h.

◆ setId()

void Entity::setId ( qint64 id)
protected

Definition at line 40 of file entity.cpp.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:13:39 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.