From 00717f6c8b8a9c6dbd56a80d685c5082fc03f6a5 Mon Sep 17 00:00:00 2001 From: Minijackson Date: Fri, 25 May 2018 11:28:22 +0200 Subject: Implement range queries --- common/domain/typeimplementations.cpp | 5 +++-- common/domain/typeimplementations_p.h | 18 +++++++++++++++++- 2 files changed, 20 insertions(+), 3 deletions(-) (limited to 'common/domain') diff --git a/common/domain/typeimplementations.cpp b/common/domain/typeimplementations.cpp index e65c998..a8f4baf 100644 --- a/common/domain/typeimplementations.cpp +++ b/common/domain/typeimplementations.cpp @@ -38,7 +38,7 @@ using namespace Sink::ApplicationDomain; MAPPER.addMapping(&Sink::ApplicationDomain::Buffer::ENTITYTYPE::LOWERCASEPROPERTY, &Sink::ApplicationDomain::Buffer::ENTITYTYPE##Builder::add_##LOWERCASEPROPERTY); typedef IndexConfig, + SortedIndex, ValueIndex, ValueIndex, ValueIndex, @@ -64,7 +64,8 @@ typedef IndexConfig AddressbookIndexConfig; typedef IndexConfig + ValueIndex, + SortedIndex > EventIndexConfig; typedef IndexConfig +template class SortedIndex { public: @@ -78,6 +78,22 @@ public: } }; +template +class SortedIndex +{ +public: + static void configure(TypeIndex &index) + { + index.addSortedProperty(); + } + + template + static QMap databases() + { + return {{QByteArray{EntityType::name} +".index." + SortProperty::name + ".sorted", 1}}; + } +}; + template class SecondaryIndex { -- cgit v1.2.3