diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-04-10 22:33:57 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-04-10 22:33:57 +0200 |
commit | 9f5e4a488360c2c0232a12b65e9d1c8366c0bc8b (patch) | |
tree | 20e35a0ba6d6c2ab1a7b304902a1205eb61547cb /common | |
parent | 161bc918e745801bcf7fa5a9f504c721aab08258 (diff) | |
download | sink-9f5e4a488360c2c0232a12b65e9d1c8366c0bc8b.tar.gz sink-9f5e4a488360c2c0232a12b65e9d1c8366c0bc8b.zip |
accountstest and a way to create new entities
Diffstat (limited to 'common')
-rw-r--r-- | common/domain/applicationdomaintype.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/common/domain/applicationdomaintype.h b/common/domain/applicationdomaintype.h index 9650a21..5ecd9eb 100644 --- a/common/domain/applicationdomaintype.h +++ b/common/domain/applicationdomaintype.h | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <QVariant> | 24 | #include <QVariant> |
25 | #include <QByteArray> | 25 | #include <QByteArray> |
26 | #include <QDebug> | 26 | #include <QDebug> |
27 | #include <QUuid> | ||
27 | #include "bufferadaptor.h" | 28 | #include "bufferadaptor.h" |
28 | 29 | ||
29 | namespace Sink { | 30 | namespace Sink { |
@@ -55,6 +56,14 @@ public: | |||
55 | return QSharedPointer<DomainType>::create(domainType.mResourceInstanceIdentifier, QByteArray(domainType.mIdentifier.constData(), domainType.mIdentifier.size()), domainType.mRevision, memoryAdaptor); | 56 | return QSharedPointer<DomainType>::create(domainType.mResourceInstanceIdentifier, QByteArray(domainType.mIdentifier.constData(), domainType.mIdentifier.size()), domainType.mRevision, memoryAdaptor); |
56 | } | 57 | } |
57 | 58 | ||
59 | template <class DomainType> | ||
60 | static DomainType createEntity() | ||
61 | { | ||
62 | DomainType object; | ||
63 | object.mIdentifier = QUuid::createUuid().toByteArray(); | ||
64 | return object; | ||
65 | } | ||
66 | |||
58 | virtual ~ApplicationDomainType(); | 67 | virtual ~ApplicationDomainType(); |
59 | 68 | ||
60 | bool hasProperty(const QByteArray &key) const; | 69 | bool hasProperty(const QByteArray &key) const; |