]> ToastFreeware Gitweb - toast/confclerk.git/blobdiff - src/orm/ormrecord.h
search fix
[toast/confclerk.git] / src / orm / ormrecord.h
index f3c0fcc87ca2a7d7173bd9c9f34e98753f205f76..a815c8e08287565b074a2fc771616e5bd38fd274 100644 (file)
 
 class OrmException
 {
+public:
+    OrmException(const QString& text) : mText(text) {};
+    virtual ~OrmException(){};
+    virtual const QString& text() const { return mText; }
+private:
+    QString mText;
 };
 
-class OrmNoObjectException : OrmException
+class OrmNoObjectException : public OrmException
 {
+public:
+    OrmNoObjectException() : OrmException("No object exception"){};
+    ~OrmNoObjectException(){};
 };
 
-class OrmSqlException : OrmException
+class OrmSqlException : public OrmException
 {
 public:
-    OrmSqlException(const QString& text) : mText(text) {}
-    QString text() const { return mText; }
-
-private:
-    QString mText;
+    OrmSqlException(const QString& text) : OrmException( QString("Sql error: ") + text ) {};
+    ~OrmSqlException(){};
 };
 
 template <typename T>