#include <authors.hpp>
◆ Authors()
Authors::Authors |
( |
QObject * |
parent = 0 | ) |
|
|
explicit |
Constructs a database interface to the Authors table. The implementation of the interface to the Authors table in the database provides a wrapper around the SQL functions needed to access and maintain records in the Authors table of the database. Implementation is the same no matter what database server is used.
Database access is provided by public methods:
bool:save(AuthorsRecord rec)
bool:del(AuthorsRecord rec)
bool:update(AuthorsRecord rec)
bool:findAuthorsID(AuthorsRecord rec)
bool:findAuthorName(QString strCall)(int id)
QSqlQuery:findAll()
QSqlQuery:findID(quint32 id)
QSqlQuery:findAuthors(QString callstr)
- Parameters
-
◆ ~Authors()
◆ del()
bool del(AuthorsRecord 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 Authors::depchk |
( |
int |
id | ) |
|
SQL function to check if author 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 AuthKey in Books table returns true
◆ findAll()
QSqlQuery Authors::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
◆ findAuthor()
QSqlQuery Authors::findAuthor |
( |
QString |
FName, |
|
|
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
◆ findAuthorName()
bool Authors::findAuthorName |
( |
QString |
strFName, |
|
|
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
◆ findAuthorsRecord()
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
◆ findID()
QSqlQuery Authors::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 Authors::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
◆ getAuthorsRec()
SQL query returns a AuthorsRecord 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
- AuthorsRecord - Success returns AuthorsRecord result - falure returns empty record
◆ getLastErr()
quint32 Authors::getLastErr |
( |
| ) |
|
|
inline |
◆ getLastErrMsg()
QString Authors::getLastErrMsg |
( |
| ) |
|
|
inline |
◆ save()
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()
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
◆ db
◆ err
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:
◆ errmsg
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:
The documentation for this class was generated from the following files: