Files
cpp-opds/src/database/book_s.h

49 lines
918 B
C
Raw Normal View History

// file : hello/person.hxx
// copyright : not copyrighted - public domain
#ifndef BOOK_S_H
#define BOOK_S_H
2025-08-03 00:14:45 +05:00
#include "database_global.h"
2025-08-03 00:14:45 +05:00
#include <QString>
#include <QSharedPointer>
#include <odb/core.hxx>
#include "author_s.h"
#pragma db object
2025-08-03 00:14:45 +05:00
class DATABASE_EXPORT Book_S
{
public:
Book_S() = default;
2025-08-03 00:14:45 +05:00
Book_S(const QString & name,
const QSharedPointer<Author_S>& author,
const int year)
{
m_author = author;
m_name = name;
m_year = year;
};
unsigned long long id() const { return m_id; }
2025-08-03 00:14:45 +05:00
QSharedPointer<Author_S> author() const { return m_author; }
QString name() const { return m_name; }
int year() const { return m_year; }
private:
friend class odb::access;
private:
#pragma db id auto
unsigned long long m_id;
2025-08-03 00:14:45 +05:00
QSharedPointer<Author_S> m_author;
QString m_name;
int m_year;
};
#endif // BOOK_S_H