本文整理汇总了C++中Book::getId方法的典型用法代码示例。如果您正苦于以下问题:C++ Book::getId方法的具体用法?C++ Book::getId怎么用?C++ Book::getId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Book
的用法示例。
在下文中一共展示了Book::getId方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: addAreaToBook
void pgBook::addAreaToBook(Book book, Area area)
{
pgAreasBooks areasBooksRelation(this->driver);
data areaBookData;
areaBookData["area_id"] = area.getId();
areaBookData["book_id"] = book.getId();
AreasBooks item(areaBookData);
areasBooksRelation.create(item);
}
示例2: addAuthorToBook
void pgBook::addAuthorToBook(Book book, Author author)
{
pgAuthorsBooks authorsBooksRelation(this->driver);
data authorBookData;
authorBookData["author_id"] = author.getId();
authorBookData["book_id"] = book.getId();
AuthorsBooks item(authorBookData);
authorsBooksRelation.create(item);
}
示例3: updateBook
/**
* @brief Updates book.
*
* @param b Book to be updated.
*
* This method updates every field of the book, except the id and the referenced
* authors, publishers and themes.
*/
void BookCollection::updateBook(Book b) throw(DataBaseException)
{
PreparedStatement updBook("UPDATE books SET isbn = '%1', title = '%2',"
" edition = '%3', description = '%4', critique = '%5', rating ="
" '%6', cover = '%7', ebook = '%8', publishingyear = '%9', udc ="
" '%10', translator = '%11' WHERE id = '%12'", db->getType());
updBook.arg(b.getIsbn());
updBook.arg(b.getTitle().toStdString());
updBook.arg(b.getEdition());
updBook.arg(b.getDescription().toStdString());
updBook.arg(b.getCritique().toStdString());
updBook.arg(b.getRating());
updBook.arg(b.getCover().toStdString());
updBook.arg(b.getEbook().toStdString());
updBook.arg(b.getPubDate().toString("yyyy-MM-dd").toStdString());
updBook.arg(b.getUDC().toStdString());
updBook.arg(b.getTranslator().getId());
updBook.arg(b.getId());
db->exec(updBook);
}