Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 24c5480c

Von Christian Ehringfeld vor etwa 9 Jahren hinzugefügt

  • ID 24c5480c79dfbbe30c36d75c8751b8b284cf59da
  • Vorgänger b0bf458e
  • Nachfolger 24425325

...

Unterschiede anzeigen:

src/entity.h
#include <QDebug>
#include <QObject>
#include "enums/databasetype.h"
#include "relation.h"
#include <QStringList>
namespace CuteEntityManager {
class Entity : public QObject {
Q_OBJECT
Q_PROPERTY(qint64 firstName READ getId WRITE setId NOTIFY idChanged)
Q_PROPERTY(qint64 id READ getId WRITE setId NOTIFY idChanged)
signals:
void idChanged();
......
virtual QString toString();
virtual ~Entity();
virtual QString getTablename();
virtual QList<Relation> getRelations();
/**
* You should return the names of properties which should not persisted e.g. Properties which are only exposed to qml
* @brief getTransientAttributes
* @return
*/
virtual QStringList getTransientAttributes();
// virtual QMap<QString, QString> getManyToManyRelations() = 0; //Key = Table, Value = joined Table Column
virtual qint64 getId() const;
virtual void setId(const qint64 &value);
virtual QStringList getBLOBColumns();
//return value must be the exact name defined in Q_PROPERTY
virtual QString getPrimaryKey();
protected:
qint64 id;
qint32 getId() const;
void setId(const qint32 &value);
protected:
qint32 id;
};
}
//Q_DECLARE_METATYPE(CuteEntityManager::Entity)
//Q_DECLARE_METATYPE(CuteEntityManager::Entity*)
#endif // ENTITY_H

Auch abrufbar als: Unified diff