From 2c0315f31e322c3a951e5aad8816723440ae860d Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Mon, 25 May 2015 17:00:51 +0200 Subject: Refactored query in facade First prepare the result set, then retrieve it. --- common/clientapi.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'common') diff --git a/common/clientapi.h b/common/clientapi.h index 05c4675..ee4ef3f 100644 --- a/common/clientapi.h +++ b/common/clientapi.h @@ -112,6 +112,14 @@ public: { } + template + static typename DomainType::Ptr getInMemoryRepresentation(const ApplicationDomainType::Ptr &domainType) + { + //TODO only copy requested properties + auto memoryAdaptor = QSharedPointer::create(*(domainType->mAdaptor)); + return QSharedPointer::create(domainType->mResourceName, domainType->mIdentifier, domainType->mRevision, memoryAdaptor); + } + virtual ~ApplicationDomainType() {} virtual QVariant getProperty(const QByteArray &key) const { return mAdaptor->getProperty(key); } @@ -125,7 +133,7 @@ private: /* * Each domain object needs to store the resource, identifier, revision triple so we can link back to the storage location. */ - QString mResourceName; + QByteArray mResourceName; QByteArray mIdentifier; qint64 mRevision; }; -- cgit v1.2.3