#ifndef ROLE_H #define ROLE_H #include "core-data.h" #include #include #include #include #include #include #include #pragma db object class Role : public QObject { Q_OBJECT Q_PROPERTY(QString name READ name WRITE setName) Q_PROPERTY(QDateTime lastModDate READ lastModDate WRITE setLastModDate) Q_PROPERTY(QDateTime createDate READ createDate WRITE setCreateDate) Q_PROPERTY(bool active READ active WRITE setActive) public: explicit Role(QObject *parent = 0); int id() const; void setId(int id); QString name() const; void setName(const QString &name); QDateTime lastModDate() const; void setLastModDate(const QDateTime &lastModDate); QDateTime createDate() const; void setCreateDate(const QDateTime &createDate); bool active() const; void setActive(bool active); QList > listUsers() const; void setListUsers(const QList > &listUsers); QList > listPermissions() const; void setListPermissions(const QList > &listPermissions); void addPermission(QSharedPointer perm); void clearPermissions(); private: friend class odb::access; #pragma db id auto int m_id; QString m_name; QDateTime m_lastModDate; QDateTime m_createDate; bool m_active; #pragma db value_not_null inverse(m_listRoles) QOdbList > m_listUsers; #pragma db value_not_null QOdbList > m_listPermissions; }; #endif // ROLE_H