#ifndef PERSON_H #define PERSON_H #include #include #include "address.h" #include #pragma db object class Person : public QObject { Q_OBJECT Q_PROPERTY(QString firstName READ getFirstName WRITE setFirstName) Q_PROPERTY(QString lastName READ getLastName WRITE setLastName) Q_PROPERTY(QSharedPointer address READ address WRITE setAddress) public: Person(); int getId() const; void setId(int value); QString getFirstName() const; void setFirstName(const QString &value); QString getLastName() const; void setLastName(const QString &value); QSharedPointer address() const; void setAddress(const QSharedPointer &address); private: friend class odb::access; #pragma db id auto int id; QString firstName; QString lastName; QSharedPointer
m_address; }; #endif // PERSON_H