Подключаем еще некоторые привычные вещи работы с odb

This commit is contained in:
2025-08-03 08:14:55 +05:00
parent f4958e60bb
commit a7d667a2df
10 changed files with 122 additions and 47 deletions

View File

@@ -6,10 +6,10 @@
#include "database_global.h"
#include <QString>
#include <QSharedPointer>
#include <QString>
#include <odb/core.hxx>
#include <rcore/smarttypes.h>
#include "author_s.h"
@@ -19,8 +19,8 @@ class DATABASE_EXPORT Book_S
public:
Book_S() = default;
Book_S(const QString & name,
const QSharedPointer<Author_S>& author,
Book_S(const QString& name,
const SH<Author_S>& author,
const int year)
{
m_author = author;
@@ -29,8 +29,8 @@ public:
};
unsigned long long id() const { return m_id; }
QSharedPointer<Author_S> author() const { return m_author; }
QString name() const { return m_name; }
SH<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;
QSharedPointer<Author_S> m_author;
QString m_name;
SH<Author_S> m_author;
QString m_name;
int m_year;
};