Билдим с odb из redkitty

This commit is contained in:
2025-08-03 00:14:45 +05:00
parent 3c2b8e7cf4
commit f4958e60bb
14 changed files with 117 additions and 158 deletions

View File

@@ -4,23 +4,23 @@
#ifndef BOOK_S_H
#define BOOK_S_H
// #include <QtCore/QObject>
#include "database_global.h"
#include <memory>
#include <string>
#include <QString>
#include <QSharedPointer>
#include <odb/core.hxx>
#include "author_s.h"
#pragma db object
class __attribute__((visibility("default"))) Book_S
class DATABASE_EXPORT Book_S
{
public:
Book_S() = default;
Book_S(const std::string& name,
const std::shared_ptr<Author_S>& author,
Book_S(const QString & name,
const QSharedPointer<Author_S>& author,
const int year)
{
m_author = author;
@@ -29,8 +29,8 @@ public:
};
unsigned long long id() const { return m_id; }
std::shared_ptr<Author_S> author() const { return m_author; }
std::string name() const { return m_name; }
QSharedPointer<Author_S> author() const { return m_author; }
QString name() const { return m_name; }
int year() const { return m_year; }
private:
@@ -40,8 +40,8 @@ private:
#pragma db id auto
unsigned long long m_id;
std::shared_ptr<Author_S> m_author;
std::string m_name;
QSharedPointer<Author_S> m_author;
QString m_name;
int m_year;
};