#ifndef ROLLBACK_H
#define ROLLBACK_H

#include <QString>
#include <QMAp>
#include <QMutex>
#include <QThread>
#include <QPointer>
#include <QSemaphore>
#include "fmp_settings.h"
#include "requestmodel.h"
#include "fmglobal.h"

class QSqlDatabase;
class QSqlQuery;

class RollBack : public QThread
{
    Q_OBJECT
public:
    RollBack(QObject *parent = 0);
    ~RollBack();

    void RollWiteQuery(QSqlDatabase &_db, QSqlQuery &query);

    void run();

    static void SetRollOrder(QString orderid, QString request);

private:
    void InsertRollOrder(QSqlQuery &query);

private:
    static QMap<QString, QString> s_rollorder;
    static QMutex s_rollorder_lock;
    FMPSettings _setting;
};

#endif // ROLLBACK_H
