2017-01-01 14:05:21 +01:00
|
|
|
#ifndef CHANGE_H
|
|
|
|
#define CHANGE_H
|
|
|
|
|
|
|
|
#include <stable.h>
|
|
|
|
|
2017-01-02 15:04:27 +01:00
|
|
|
#include "models/basemodel.h"
|
2017-01-01 14:05:21 +01:00
|
|
|
|
|
|
|
namespace jop {
|
|
|
|
|
2017-01-02 15:04:27 +01:00
|
|
|
class Change : public BaseModel {
|
2017-01-01 14:05:21 +01:00
|
|
|
|
|
|
|
public:
|
|
|
|
|
2017-01-02 15:04:27 +01:00
|
|
|
enum Type { Undefined, Create, Update, Delete };
|
2017-01-01 14:05:21 +01:00
|
|
|
|
2017-01-02 15:04:27 +01:00
|
|
|
Change();
|
2017-01-02 16:28:03 +01:00
|
|
|
Change(const QSqlQuery& query);
|
2017-01-02 15:04:27 +01:00
|
|
|
Table table() const;
|
2017-01-01 14:05:21 +01:00
|
|
|
|
2017-01-02 16:28:03 +01:00
|
|
|
static QVector<Change> all(int limit = 100);
|
|
|
|
static QVector<Change> mergedChanges(const QVector<Change> &changes);
|
|
|
|
|
|
|
|
void addMergedField(const QString& name);
|
|
|
|
QStringList mergedFields() const;
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
QStringList mergedFields_;
|
|
|
|
|
2017-01-01 14:05:21 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // CHANGE_H
|