diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-05-03 13:37:50 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-05-03 13:37:50 +0200 |
commit | a5eb20dd70160f437835d4f5dffb27d8a912709d (patch) | |
tree | daabcf59b245c90957a7763b42c0504cbc2b7afd | |
parent | bbfbfc7383382ab2f9831d484e99e1bf22b608bb (diff) | |
download | sink-a5eb20dd70160f437835d4f5dffb27d8a912709d.tar.gz sink-a5eb20dd70160f437835d4f5dffb27d8a912709d.zip |
Create entities with set resourceInstanceIdentifier
-rw-r--r-- | common/domain/applicationdomaintype.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/common/domain/applicationdomaintype.h b/common/domain/applicationdomaintype.h index f7e681a..1486f00 100644 --- a/common/domain/applicationdomaintype.h +++ b/common/domain/applicationdomaintype.h | |||
@@ -64,6 +64,14 @@ public: | |||
64 | return object; | 64 | return object; |
65 | } | 65 | } |
66 | 66 | ||
67 | template <class DomainType> | ||
68 | static DomainType createEntity(const QByteArray &resourceInstanceIdentifier) | ||
69 | { | ||
70 | DomainType object(resourceInstanceIdentifier); | ||
71 | object.mIdentifier = QUuid::createUuid().toByteArray(); | ||
72 | return object; | ||
73 | } | ||
74 | |||
67 | virtual ~ApplicationDomainType(); | 75 | virtual ~ApplicationDomainType(); |
68 | 76 | ||
69 | bool hasProperty(const QByteArray &key) const; | 77 | bool hasProperty(const QByteArray &key) const; |