From 979c6670c9ae1212c66c7e4384c0b72510ede049 Mon Sep 17 00:00:00 2001 From: antao Date: Sat, 10 Nov 2018 21:31:44 +0800 Subject: [PATCH] Modify some function signatures --- orm_lib/inc/drogon/orm/Mapper.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/orm_lib/inc/drogon/orm/Mapper.h b/orm_lib/inc/drogon/orm/Mapper.h index 2a5c0e45..b0717fa5 100644 --- a/orm_lib/inc/drogon/orm/Mapper.h +++ b/orm_lib/inc/drogon/orm/Mapper.h @@ -55,11 +55,11 @@ class Mapper const ExceptionCallback &ecb) noexcept; std::future> findFutureAll() noexcept; - size_t count(const Criteria &criteria) noexcept(false); + size_t count(const Criteria &criteria = Criteria()) noexcept(false); void count(const Criteria &criteria, const CountCallback &rcb, const ExceptionCallback &ecb) noexcept; - std::future countFuture(const Criteria &criteria) noexcept; + std::future countFuture(const Criteria &criteria = Criteria()) noexcept; T findOne(const Criteria &criteria) noexcept(false); void findOne(const Criteria &criteria, @@ -145,7 +145,7 @@ template inline T Mapper::findByPrimaryKey(const typename T::PrimaryKeyType &key) noexcept(false) { static_assert(!std::is_same::value, "No primary key in the table!"); - // return findOne(Criteria(T::primaryKeyName, key)); + // return findOne(Criteria(T::primaryKeyName, key)); std::string sql = "select * from "; sql += T::tableName; makePrimaryKeyCriteria(sql); @@ -154,7 +154,7 @@ inline T Mapper::findByPrimaryKey(const typename T::PrimaryKeyType &key) noex Result r(nullptr); { auto binder = _client << sql; - outputPrimeryKeyToBinder(key,binder); + outputPrimeryKeyToBinder(key, binder); binder << Mode::Blocking; binder >> [&r](const Result &result) { r = result;