From 6df1460d02811511568caa2788872c40a11a2260 Mon Sep 17 00:00:00 2001 From: Hamed Masafi Date: Mon, 8 Feb 2021 18:52:44 +0330 Subject: [PATCH] fix: relation id in select clause --- .gitmodules | 3 --- 3rdparty/serializer | 1 - src/nut/config/nut_macros.h | 2 +- tests/auto/tst_properties/tst_properties.cpp | 3 ++- 4 files changed, 3 insertions(+), 6 deletions(-) delete mode 160000 3rdparty/serializer diff --git a/.gitmodules b/.gitmodules index bb74164..8251c1c 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,6 +1,3 @@ [submodule "src/nut/3rdparty/serializer"] path = src/nut/3rdparty/serializer url = https://github.com/HamedMasafi/Serializer.git -[submodule "3rdparty/serializer"] - path = 3rdparty/serializer - url = https://github.com/HamedMasafi/Serializer.git diff --git a/3rdparty/serializer b/3rdparty/serializer deleted file mode 160000 index 0e794d6..0000000 --- a/3rdparty/serializer +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 0e794d6317595d077e95e8a06f1f3a8c92543b05 diff --git a/src/nut/config/nut_macros.h b/src/nut/config/nut_macros.h index 80e8758..525cb6d 100644 --- a/src/nut/config/nut_macros.h +++ b/src/nut/config/nut_macros.h @@ -82,7 +82,7 @@ public: \ static NUT_WRAP_NAMESPACE(FieldPhrase)& name##Id ## Field(){ \ static NUT_WRAP_NAMESPACE(FieldPhrase) f = \ NUT_WRAP_NAMESPACE(FieldPhrase) \ - (staticMetaObject.className(), #name); \ + (staticMetaObject.className(), #name "Id"); \ return f; \ } \ public slots: \ diff --git a/tests/auto/tst_properties/tst_properties.cpp b/tests/auto/tst_properties/tst_properties.cpp index e197280..56bfc02 100644 --- a/tests/auto/tst_properties/tst_properties.cpp +++ b/tests/auto/tst_properties/tst_properties.cpp @@ -34,13 +34,14 @@ void PropertiesTest::insert() s->setName("hamed"); s->setLastName("masafi"); db.items()->append(s); - auto c = db.saveChanges(); + auto c = db.saveChanges(); // returns count of affected rows QCOMPARE(c, 1); } void PropertiesTest::select() { auto item = db.items()->query() + .where(SampleTable::nameField() == "hamed" && SampleTable::lastNameField() == "masafi") .first(); QCOMPARE(item->name(), "hamed"); }