MyBooks
Public Member Functions | Properties | Private Attributes | List of all members
MediaType Class Reference

#include <mediatype.hpp>

Inheritance diagram for MediaType:
Inheritance graph
[legend]
Collaboration diagram for MediaType:
Collaboration graph
[legend]

Public Member Functions

 MediaType (QObject *parent=0)
 
virtual ~MediaType ()
 
quint32 getLastErr ()
 
QString getLastErrMsg ()
 
bool depchk (int id)
 
bool save (MediaTypeRecord rec)
 
bool del (MediaTypeRecord rec)
 
bool update (MediaTypeRecord rec)
 
quint32 findLastID ()
 
bool findMediaTypeRecord (MediaTypeRecord rec)
 
bool findAMedia (QString strLName)
 
QSqlQuery findAll ()
 
QSqlQuery findID (quint32 id)
 
QSqlQuery findMedia (QString strLName)
 
MediaTypeRecord getMediaTypeRec (QString strLName)
 

Properties

quint32 err
 
QString errmsg
 

Private Attributes

QSqlDatabase db
 

Constructor & Destructor Documentation

◆ MediaType()

MediaType::MediaType ( QObject *  parent = 0)
explicit

Constructs a database interface to the MediaType table. The implementation of the interface to the MediaType table in the database provides a wrapper around the SQL functions needed to access and maintain records in the MediaType table of the database. Implementation is the same no matter what database server is used.

Database access is provided by public methods:

bool:save(MediaTypeRecord rec)
bool:del(MediaTypeRecord rec)
bool:update(MediaTypeRecord rec)
bool:findMediaTypeID(MediaTypeRecord rec)
bool:findMedia(QString strCall)(int id)
QSqlQuery:findAll()
QSqlQuery:findID(quint32 id)
QSqlQuery:findMediaType(QString callstr)

Parameters
QObject*parent

◆ ~MediaType()

MediaType::~MediaType ( )
virtual

Member Function Documentation

◆ del()

bool MediaType::del ( MediaTypeRecord  rec)

  bool del(MediaTypeRecord rec)

SQL function to delete a specific author record. This is an interface function to perform SQL database functions regardless of what type of database is used.

Returns
bool Success - returns true

◆ depchk()

bool MediaType::depchk ( int  id)

SQL function to check if media type is used in books table. This is an interface function to perform SQL database functions regardless of what type of database is used.

Returns
bool - If found as MediaKey in Books table returns true

◆ findAll()

QSqlQuery MediaType::findAll ( )

SQL query returning all rows in the table. This is an interface function to perform SQL database functions regardless of what type of database is used.

Returns
QSqlQuery - Success returns QSqlQuery result of all rows - falure returns null

◆ findAMedia()

bool MediaType::findAMedia ( QString  strLName)

SQL function returns true if author is found for a specific author record. This is an interface function to perform SQL database functions regardless of what type of database is used.

Returns
bool - Success returns true if author specific first and last name exists

◆ findID()

QSqlQuery MediaType::findID ( quint32  id)

SQL query returns SQL query result of one row with id. This is an interface function to perform SQL database functions regardless of what type of database is used.

Returns
QSqlQuery - Success returns QSqlQuery result of rows with ID - falure returns null

◆ findLastID()

quint32 MediaType::findLastID ( )

SQL function returns the highest value of ID for all author records. This is an interface function to perform SQL database functions regardless of what type of database is used.

Returns
unsigned long - Success returns true

◆ findMedia()

QSqlQuery MediaType::findMedia ( QString  strLName)

SQL query returns SQL query result of rows that match the pattern in callstr. This is an interface function to perform SQL database functions regardless of what type of database is used.

Returns
QSqlQuery - Success returns QSqlQuery result of all rows - falure returns null

◆ findMediaTypeRecord()

bool MediaType::findMediaTypeRecord ( MediaTypeRecord  rec)

SQL function returns true if author is found for a specific author record. This is an interface function to perform SQL database functions regardless of what type of database is used.

Returns
bool - Success returns true

◆ getLastErr()

quint32 MediaType::getLastErr ( )
inline

◆ getLastErrMsg()

QString MediaType::getLastErrMsg ( )
inline
Here is the call graph for this function:

◆ getMediaTypeRec()

MediaTypeRecord MediaType::getMediaTypeRec ( QString  strLName)

SQL query returns a MediaTypeRecord with data to match the author in strcall. This is an interface function to perform SQL database functions regardless of what type of database is used.

Returns
MediaTypeRecord - Success returns MediaTypeRecord result - falure returns empty record

◆ save()

bool MediaType::save ( MediaTypeRecord  rec)

SQL function to save author record. This is an interface functiont to perform SQL database functions regardless of what type of database is used.

Returns
bool - Success returns true

◆ update()

bool MediaType::update ( MediaTypeRecord  rec)

SQL function to update a specific author record. This is an interface function to perform SQL database functions regardless of what type of database is used.

Returns
bool - Success returns true

Member Data Documentation

◆ db

QSqlDatabase MediaType::db
private

Property Documentation

◆ err

quint32 MediaType::err
read

Property local value storage This property holds the last error number to be returned.

The number will be returned from the database table handler upon last action.

The default value of this property is QSqlDatabase::NoError (0).

Access functions:

  QString getLastErr()

◆ errmsg

QString MediaType::errmsg
read

Property local value storage This property holds the message text to be displayed.

The text will be returned from the database table handler upon last action.

The default value of this property is an empty string.

Access functions:

  QString getLastErrMsg()

The documentation for this class was generated from the following files: