Skip to content

Commit 8701834

Browse files
committed
update to oatpp140
1 parent c175890 commit 8701834

26 files changed

+288
-283
lines changed

CMakeLists.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
cmake_minimum_required(VERSION 3.1 FATAL_ERROR)
1+
cmake_minimum_required(VERSION 3.20)
22

33
###################################################################################################
44
## These variables are passed to oatpp-module-install.cmake script
55
## use these variables to configure module installation
66

77
set(OATPP_THIS_MODULE_NAME oatpp-postgresql) ## name of the module (also name of folders in installation dirs)
8-
set(OATPP_THIS_MODULE_VERSION "1.3.0") ## version of the module (also sufix of folders in installation dirs)
8+
set(OATPP_THIS_MODULE_VERSION "1.4.0") ## version of the module (also sufix of folders in installation dirs)
99
set(OATPP_THIS_MODULE_LIBRARIES oatpp-postgresql) ## list of libraries to find when find_package is called
1010
set(OATPP_THIS_MODULE_TARGETS oatpp-postgresql) ## list of targets to install
1111
set(OATPP_THIS_MODULE_DIRECTORIES oatpp-postgresql) ## list of directories to install
@@ -92,6 +92,8 @@ endif()
9292
message("\n############################################################################")
9393
message("## ${OATPP_THIS_MODULE_NAME} module. Resolving dependencies...\n")
9494

95+
set(PostgreSQL_ADDITIONAL_VERSIONS "17")
96+
9597
find_package(PostgreSQL REQUIRED)
9698

9799
message("PostgreSQL_INCLUDE_DIRS=${PostgreSQL_INCLUDE_DIRS}")

src/oatpp-postgresql/Connection.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
#define oatpp_postgresql_Connection_hpp
2727

2828
#include "oatpp/orm/Connection.hpp"
29-
#include "oatpp/core/provider/Pool.hpp"
30-
#include "oatpp/core/Types.hpp"
29+
#include "oatpp/provider/Pool.hpp"
30+
#include "oatpp/Types.hpp"
3131

3232
#include <libpq-fe.h>
3333

src/oatpp-postgresql/ConnectionProvider.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727

2828
#include "Connection.hpp"
2929

30-
#include "oatpp/core/provider/Pool.hpp"
31-
#include "oatpp/core/Types.hpp"
30+
#include "oatpp/provider/Pool.hpp"
31+
#include "oatpp/Types.hpp"
3232

3333
namespace oatpp { namespace postgresql {
3434

src/oatpp-postgresql/Executor.cpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@
3131

3232
#include "oatpp/orm/Transaction.hpp"
3333

34-
#include "oatpp/core/macro/codegen.hpp"
34+
#include "oatpp/macro/codegen.hpp"
35+
36+
#include "oatpp/base/Log.hpp"
3537

3638
#include <vector>
3739

@@ -152,7 +154,7 @@ std::shared_ptr<data::mapping::TypeResolver> Executor::createTypeResolver() {
152154

153155
Executor::QueryParameter Executor::parseQueryParameter(const oatpp::String& paramName) {
154156

155-
parser::Caret caret(paramName);
157+
utils::parser::Caret caret(paramName);
156158
auto nameLabel = caret.putLabel();
157159
if(caret.findChar('.') && caret.getPosition() < caret.getDataSize() - 1) {
158160

@@ -499,7 +501,7 @@ void Executor::migrateSchema(const oatpp::String& script,
499501
}
500502

501503
if(script->size() == 0) {
502-
OATPP_LOGW("[oatpp::postgresql::Executor::migrateSchema()]", "Warning. Executing empty script for version %d", newVersion);
504+
OATPP_LOGw("[oatpp::postgresql::Executor::migrateSchema()]", "Warning. Executing empty script for version {}", newVersion);
503505
}
504506

505507
{
@@ -510,16 +512,16 @@ void Executor::migrateSchema(const oatpp::String& script,
510512

511513
result = exec(script, connection);
512514
if(!result->isSuccess()) {
513-
OATPP_LOGE("[oatpp::postgresql::Executor::migrateSchema()]",
514-
"Error. Migration failed for version %d. %s", newVersion, result->getErrorMessage()->c_str());
515+
OATPP_LOGe("[oatpp::postgresql::Executor::migrateSchema()]",
516+
"Error. Migration failed for version {}. {}", newVersion, result->getErrorMessage()->c_str());
515517
throw std::runtime_error("[oatpp::postgresql::Executor::migrateSchema()]: "
516518
"Error. Migration failed. " + *result->getErrorMessage());
517519

518520
}
519521

520522
result = updateSchemaVersion(newVersion, suffix, connection);
521523

522-
if(!result->isSuccess() || result->hasMoreToFetch() > 0) {
524+
if(!result->isSuccess() || result->hasMoreToFetch()) {
523525
throw std::runtime_error("[oatpp::postgresql::Executor::migrateSchema()]: Error. Migration failed. Can't set new version.");
524526
}
525527

src/oatpp-postgresql/Executor.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
#include "Types.hpp"
3434

3535
#include "oatpp/orm/Executor.hpp"
36-
#include "oatpp/core/parser/Caret.hpp"
36+
#include "oatpp/utils/parser/Caret.hpp"
3737

3838
#include <vector>
3939

src/oatpp-postgresql/Types.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ namespace oatpp { namespace postgresql {
3232
/**
3333
* Uuid as oatpp primitive type.
3434
*/
35-
typedef oatpp::data::mapping::type::Primitive<mapping::type::UuidObject, mapping::type::__class::Uuid> Uuid;
35+
typedef oatpp::data::type::Primitive<mapping::type::UuidObject, mapping::type::__class::Uuid> Uuid;
3636

3737
}}
3838

src/oatpp-postgresql/mapping/Deserializer.cpp

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -41,44 +41,44 @@ Deserializer::InData::InData(PGresult* dbres, int row, int col, const std::share
4141

4242
Deserializer::Deserializer() {
4343

44-
m_methods.resize(data::mapping::type::ClassId::getClassCount(), nullptr);
44+
m_methods.resize(data::type::ClassId::getClassCount(), nullptr);
4545

46-
setDeserializerMethod(data::mapping::type::__class::String::CLASS_ID, &Deserializer::deserializeString);
47-
setDeserializerMethod(data::mapping::type::__class::Any::CLASS_ID, &Deserializer::deserializeAny);
46+
setDeserializerMethod(data::type::__class::String::CLASS_ID, &Deserializer::deserializeString);
47+
setDeserializerMethod(data::type::__class::Any::CLASS_ID, &Deserializer::deserializeAny);
4848

49-
setDeserializerMethod(data::mapping::type::__class::Int8::CLASS_ID, &Deserializer::deserializeInt<oatpp::Int8>);
50-
setDeserializerMethod(data::mapping::type::__class::UInt8::CLASS_ID, &Deserializer::deserializeInt<oatpp::UInt8>);
49+
setDeserializerMethod(data::type::__class::Int8::CLASS_ID, &Deserializer::deserializeInt<oatpp::Int8>);
50+
setDeserializerMethod(data::type::__class::UInt8::CLASS_ID, &Deserializer::deserializeInt<oatpp::UInt8>);
5151

52-
setDeserializerMethod(data::mapping::type::__class::Int16::CLASS_ID, &Deserializer::deserializeInt<oatpp::Int16>);
53-
setDeserializerMethod(data::mapping::type::__class::UInt16::CLASS_ID, &Deserializer::deserializeInt<oatpp::UInt16>);
52+
setDeserializerMethod(data::type::__class::Int16::CLASS_ID, &Deserializer::deserializeInt<oatpp::Int16>);
53+
setDeserializerMethod(data::type::__class::UInt16::CLASS_ID, &Deserializer::deserializeInt<oatpp::UInt16>);
5454

55-
setDeserializerMethod(data::mapping::type::__class::Int32::CLASS_ID, &Deserializer::deserializeInt<oatpp::Int32>);
56-
setDeserializerMethod(data::mapping::type::__class::UInt32::CLASS_ID, &Deserializer::deserializeInt<oatpp::UInt32>);
55+
setDeserializerMethod(data::type::__class::Int32::CLASS_ID, &Deserializer::deserializeInt<oatpp::Int32>);
56+
setDeserializerMethod(data::type::__class::UInt32::CLASS_ID, &Deserializer::deserializeInt<oatpp::UInt32>);
5757

58-
setDeserializerMethod(data::mapping::type::__class::Int64::CLASS_ID, &Deserializer::deserializeInt<oatpp::Int64>);
59-
setDeserializerMethod(data::mapping::type::__class::UInt64::CLASS_ID, &Deserializer::deserializeInt<oatpp::UInt64>);
58+
setDeserializerMethod(data::type::__class::Int64::CLASS_ID, &Deserializer::deserializeInt<oatpp::Int64>);
59+
setDeserializerMethod(data::type::__class::UInt64::CLASS_ID, &Deserializer::deserializeInt<oatpp::UInt64>);
6060

61-
setDeserializerMethod(data::mapping::type::__class::Float32::CLASS_ID, &Deserializer::deserializeFloat32);
62-
setDeserializerMethod(data::mapping::type::__class::Float64::CLASS_ID, &Deserializer::deserializeFloat64);
63-
setDeserializerMethod(data::mapping::type::__class::Boolean::CLASS_ID, &Deserializer::deserializeBoolean);
61+
setDeserializerMethod(data::type::__class::Float32::CLASS_ID, &Deserializer::deserializeFloat32);
62+
setDeserializerMethod(data::type::__class::Float64::CLASS_ID, &Deserializer::deserializeFloat64);
63+
setDeserializerMethod(data::type::__class::Boolean::CLASS_ID, &Deserializer::deserializeBoolean);
6464

65-
setDeserializerMethod(data::mapping::type::__class::AbstractObject::CLASS_ID, nullptr);
66-
setDeserializerMethod(data::mapping::type::__class::AbstractEnum::CLASS_ID, &Deserializer::deserializeEnum);
65+
setDeserializerMethod(data::type::__class::AbstractObject::CLASS_ID, nullptr);
66+
setDeserializerMethod(data::type::__class::AbstractEnum::CLASS_ID, &Deserializer::deserializeEnum);
6767

68-
setDeserializerMethod(data::mapping::type::__class::AbstractVector::CLASS_ID, &Deserializer::deserializeArray);
69-
setDeserializerMethod(data::mapping::type::__class::AbstractList::CLASS_ID, &Deserializer::deserializeArray);
70-
setDeserializerMethod(data::mapping::type::__class::AbstractUnorderedSet::CLASS_ID, &Deserializer::deserializeArray);
68+
setDeserializerMethod(data::type::__class::AbstractVector::CLASS_ID, &Deserializer::deserializeArray);
69+
setDeserializerMethod(data::type::__class::AbstractList::CLASS_ID, &Deserializer::deserializeArray);
70+
setDeserializerMethod(data::type::__class::AbstractUnorderedSet::CLASS_ID, &Deserializer::deserializeArray);
7171

72-
setDeserializerMethod(data::mapping::type::__class::AbstractPairList::CLASS_ID, nullptr);
73-
setDeserializerMethod(data::mapping::type::__class::AbstractUnorderedMap::CLASS_ID, nullptr);
72+
setDeserializerMethod(data::type::__class::AbstractPairList::CLASS_ID, nullptr);
73+
setDeserializerMethod(data::type::__class::AbstractUnorderedMap::CLASS_ID, nullptr);
7474

7575
////
7676

7777
setDeserializerMethod(postgresql::mapping::type::__class::Uuid::CLASS_ID, &Deserializer::deserializeUuid);
7878

7979
}
8080

81-
void Deserializer::setDeserializerMethod(const data::mapping::type::ClassId& classId, DeserializerMethod method) {
81+
void Deserializer::setDeserializerMethod(const data::type::ClassId& classId, DeserializerMethod method) {
8282
const v_uint32 id = classId.id;
8383
if(id >= m_methods.size()) {
8484
m_methods.resize(id + 1, nullptr);
@@ -235,21 +235,21 @@ oatpp::Void Deserializer::deserializeBoolean(const Deserializer* _this, const In
235235

236236
oatpp::Void Deserializer::deserializeEnum(const Deserializer* _this, const InData& data, const Type* type) {
237237

238-
auto polymorphicDispatcher = static_cast<const data::mapping::type::__class::AbstractEnum::PolymorphicDispatcher*>(
238+
auto polymorphicDispatcher = static_cast<const data::type::__class::AbstractEnum::PolymorphicDispatcher*>(
239239
type->polymorphicDispatcher
240240
);
241241

242-
data::mapping::type::EnumInterpreterError e = data::mapping::type::EnumInterpreterError::OK;
242+
data::type::EnumInterpreterError e = data::type::EnumInterpreterError::OK;
243243
const auto& value = _this->deserialize(data, polymorphicDispatcher->getInterpretationType());
244244

245-
const auto& result = polymorphicDispatcher->fromInterpretation(value, e);
245+
const auto& result = polymorphicDispatcher->fromInterpretation(value, false, e); //useUnqualifiedNames is new to oatpp 1.4.0
246246

247-
if(e == data::mapping::type::EnumInterpreterError::OK) {
247+
if(e == data::type::EnumInterpreterError::OK) {
248248
return result;
249249
}
250250

251251
switch(e) {
252-
case data::mapping::type::EnumInterpreterError::CONSTRAINT_NOT_NULL:
252+
case data::type::EnumInterpreterError::CONSTRAINT_NOT_NULL:
253253
throw std::runtime_error("[oatpp::postgresql::mapping::Deserializer::deserializeEnum()]: Error. Enum constraint violated - 'NotNull'.");
254254

255255
default:
@@ -315,7 +315,7 @@ oatpp::Void Deserializer::deserializeAny(const Deserializer* _this, const InData
315315
}
316316

317317
auto value = _this->deserialize(data, valueType);
318-
auto anyHandle = std::make_shared<data::mapping::type::AnyHandle>(value.getPtr(), value.getValueType());
318+
auto anyHandle = std::make_shared<data::type::AnyHandle>(value.getPtr(), value.getValueType());
319319

320320
return oatpp::Void(anyHandle, Any::Class::getType());
321321
}
@@ -343,7 +343,7 @@ oatpp::Void Deserializer::deserializeSubArray(const Type* type,
343343
"Error. Unknown collection type.");
344344
}
345345

346-
auto dispatcher = static_cast<const data::mapping::type::__class::Collection::PolymorphicDispatcher*>(type->polymorphicDispatcher);
346+
auto dispatcher = static_cast<const data::type::__class::Collection::PolymorphicDispatcher*>(type->polymorphicDispatcher);
347347
auto itemType = dispatcher->getItemType();
348348
auto collection = dispatcher->createObject();
349349

@@ -402,7 +402,7 @@ oatpp::Void Deserializer::deserializeArray(const Deserializer* _this, const InDa
402402

403403
auto ndim = (v_int32) ntohl(*((p_int32)data.data));
404404
if(ndim == 0) {
405-
auto dispatcher = static_cast<const data::mapping::type::__class::Collection::PolymorphicDispatcher*>(type->polymorphicDispatcher);
405+
auto dispatcher = static_cast<const data::type::__class::Collection::PolymorphicDispatcher*>(type->polymorphicDispatcher);
406406
return dispatcher->createObject(); // empty array
407407
}
408408

src/oatpp-postgresql/mapping/Deserializer.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@
2828

2929
#include "PgArray.hpp"
3030

31-
#include "oatpp/core/data/stream/BufferStream.hpp"
32-
#include "oatpp/core/data/mapping/TypeResolver.hpp"
33-
#include "oatpp/core/Types.hpp"
31+
#include "oatpp/data/stream/BufferStream.hpp"
32+
#include "oatpp/data/mapping/TypeResolver.hpp"
33+
#include "oatpp/Types.hpp"
3434

3535
#include <libpq-fe.h>
3636

@@ -78,7 +78,7 @@ class Deserializer {
7878

7979
Deserializer();
8080

81-
void setDeserializerMethod(const data::mapping::type::ClassId& classId, DeserializerMethod method);
81+
void setDeserializerMethod(const data::type::ClassId& classId, DeserializerMethod method);
8282

8383
oatpp::Void deserialize(const InData& data, const Type* type) const;
8484

src/oatpp-postgresql/mapping/PgArray.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
#ifndef oatpp_postgresql_mapping_PgArray_hpp
2727
#define oatpp_postgresql_mapping_PgArray_hpp
2828

29-
#include "oatpp/core/data/stream/Stream.hpp"
30-
#include "oatpp/core/Types.hpp"
29+
#include "oatpp/data/stream/Stream.hpp"
30+
#include "oatpp/Types.hpp"
3131

3232
#include <libpq-fe.h>
3333

src/oatpp-postgresql/mapping/ResultMapper.cpp

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
***************************************************************************/
2424

2525
#include "ResultMapper.hpp"
26+
#include "oatpp/base/Log.hpp"
2627

2728
namespace oatpp { namespace postgresql { namespace mapping {
2829

@@ -48,38 +49,38 @@ ResultMapper::ResultData::ResultData(PGresult* pDbResult, const std::shared_ptr<
4849
ResultMapper::ResultMapper() {
4950

5051
{
51-
m_readOneRowMethods.resize(data::mapping::type::ClassId::getClassCount(), nullptr);
52+
m_readOneRowMethods.resize(data::type::ClassId::getClassCount(), nullptr);
5253

53-
setReadOneRowMethod(data::mapping::type::__class::AbstractObject::CLASS_ID, &ResultMapper::readOneRowAsObject);
54+
setReadOneRowMethod(data::type::__class::AbstractObject::CLASS_ID, &ResultMapper::readOneRowAsObject);
5455

55-
setReadOneRowMethod(data::mapping::type::__class::AbstractVector::CLASS_ID, &ResultMapper::readOneRowAsCollection);
56-
setReadOneRowMethod(data::mapping::type::__class::AbstractList::CLASS_ID, &ResultMapper::readOneRowAsCollection);
57-
setReadOneRowMethod(data::mapping::type::__class::AbstractUnorderedSet::CLASS_ID, &ResultMapper::readOneRowAsCollection);
56+
setReadOneRowMethod(data::type::__class::AbstractVector::CLASS_ID, &ResultMapper::readOneRowAsCollection);
57+
setReadOneRowMethod(data::type::__class::AbstractList::CLASS_ID, &ResultMapper::readOneRowAsCollection);
58+
setReadOneRowMethod(data::type::__class::AbstractUnorderedSet::CLASS_ID, &ResultMapper::readOneRowAsCollection);
5859

59-
setReadOneRowMethod(data::mapping::type::__class::AbstractPairList::CLASS_ID, &ResultMapper::readOneRowAsMap);
60-
setReadOneRowMethod(data::mapping::type::__class::AbstractUnorderedMap::CLASS_ID, &ResultMapper::readOneRowAsMap);
60+
setReadOneRowMethod(data::type::__class::AbstractPairList::CLASS_ID, &ResultMapper::readOneRowAsMap);
61+
setReadOneRowMethod(data::type::__class::AbstractUnorderedMap::CLASS_ID, &ResultMapper::readOneRowAsMap);
6162
}
6263

6364
{
64-
m_readRowsMethods.resize(data::mapping::type::ClassId::getClassCount(), nullptr);
65+
m_readRowsMethods.resize(data::type::ClassId::getClassCount(), nullptr);
6566

66-
setReadRowsMethod(data::mapping::type::__class::AbstractVector::CLASS_ID, &ResultMapper::readRowsAsCollection);
67-
setReadRowsMethod(data::mapping::type::__class::AbstractList::CLASS_ID, &ResultMapper::readRowsAsCollection);
68-
setReadRowsMethod(data::mapping::type::__class::AbstractUnorderedSet::CLASS_ID, &ResultMapper::readRowsAsCollection);
67+
setReadRowsMethod(data::type::__class::AbstractVector::CLASS_ID, &ResultMapper::readRowsAsCollection);
68+
setReadRowsMethod(data::type::__class::AbstractList::CLASS_ID, &ResultMapper::readRowsAsCollection);
69+
setReadRowsMethod(data::type::__class::AbstractUnorderedSet::CLASS_ID, &ResultMapper::readRowsAsCollection);
6970

7071
}
7172

7273
}
7374

74-
void ResultMapper::setReadOneRowMethod(const data::mapping::type::ClassId& classId, ReadOneRowMethod method) {
75+
void ResultMapper::setReadOneRowMethod(const data::type::ClassId& classId, ReadOneRowMethod method) {
7576
const v_uint32 id = classId.id;
7677
if(id >= m_readOneRowMethods.size()) {
7778
m_readOneRowMethods.resize(id + 1, nullptr);
7879
}
7980
m_readOneRowMethods[id] = method;
8081
}
8182

82-
void ResultMapper::setReadRowsMethod(const data::mapping::type::ClassId& classId, ReadRowsMethod method) {
83+
void ResultMapper::setReadRowsMethod(const data::type::ClassId& classId, ReadRowsMethod method) {
8384
const v_uint32 id = classId.id;
8485
if(id >= m_readRowsMethods.size()) {
8586
m_readRowsMethods.resize(id + 1, nullptr);
@@ -89,7 +90,7 @@ void ResultMapper::setReadRowsMethod(const data::mapping::type::ClassId& classId
8990

9091
oatpp::Void ResultMapper::readOneRowAsCollection(ResultMapper* _this, ResultData* dbData, const Type* type, v_int64 rowIndex) {
9192

92-
auto dispatcher = static_cast<const data::mapping::type::__class::Collection::PolymorphicDispatcher*>(type->polymorphicDispatcher);
93+
auto dispatcher = static_cast<const data::type::__class::Collection::PolymorphicDispatcher*>(type->polymorphicDispatcher);
9394
auto collection = dispatcher->createObject();
9495

9596
const Type* itemType = *type->params.begin();
@@ -105,11 +106,11 @@ oatpp::Void ResultMapper::readOneRowAsCollection(ResultMapper* _this, ResultData
105106

106107
oatpp::Void ResultMapper::readOneRowAsMap(ResultMapper* _this, ResultData* dbData, const Type* type, v_int64 rowIndex) {
107108

108-
auto dispatcher = static_cast<const data::mapping::type::__class::Map::PolymorphicDispatcher*>(type->polymorphicDispatcher);
109+
auto dispatcher = static_cast<const data::type::__class::Map::PolymorphicDispatcher*>(type->polymorphicDispatcher);
109110
auto map = dispatcher->createObject();
110111

111112
const Type* keyType = dispatcher->getKeyType();
112-
if(keyType->classId.id != oatpp::data::mapping::type::__class::String::CLASS_ID.id){
113+
if(keyType->classId.id != oatpp::data::type::__class::String::CLASS_ID.id){
113114
throw std::runtime_error("[oatpp::postgresql::mapping::ResultMapper::readOneRowAsMap()]: Invalid map key. Key should be String");
114115
}
115116

@@ -125,7 +126,7 @@ oatpp::Void ResultMapper::readOneRowAsMap(ResultMapper* _this, ResultData* dbDat
125126

126127
oatpp::Void ResultMapper::readOneRowAsObject(ResultMapper* _this, ResultData* dbData, const Type* type, v_int64 rowIndex) {
127128

128-
auto dispatcher = static_cast<const data::mapping::type::__class::AbstractObject::PolymorphicDispatcher*>(type->polymorphicDispatcher);
129+
auto dispatcher = static_cast<const data::type::__class::AbstractObject::PolymorphicDispatcher*>(type->polymorphicDispatcher);
129130
auto object = dispatcher->createObject();
130131
const auto& fieldsMap = dispatcher->getProperties()->getMap();
131132

@@ -138,8 +139,8 @@ oatpp::Void ResultMapper::readOneRowAsObject(ResultMapper* _this, ResultData* db
138139
mapping::Deserializer::InData inData(dbData->dbResult, rowIndex, i, dbData->typeResolver);
139140
field->set(static_cast<oatpp::BaseObject*>(object.get()), _this->m_deserializer.deserialize(inData, field->type));
140141
} else {
141-
OATPP_LOGE("[oatpp::postgresql::mapping::ResultMapper::readRowAsObject]",
142-
"Error. The object of type '%s' has no field to map column '%s'.",
142+
OATPP_LOGe("[oatpp::postgresql::mapping::ResultMapper::readRowAsObject]",
143+
"Error. The object of type '{}' has no field to map column '{}'.",
143144
type->nameQualifier, dbData->colNames[i]->c_str());
144145
throw std::runtime_error("[oatpp::postgresql::mapping::ResultMapper::readRowAsObject]: Error. "
145146
"The object of type " + std::string(type->nameQualifier) +
@@ -154,7 +155,7 @@ oatpp::Void ResultMapper::readOneRowAsObject(ResultMapper* _this, ResultData* db
154155

155156
oatpp::Void ResultMapper::readRowsAsCollection(ResultMapper* _this, ResultData* dbData, const Type* type, v_int64 count) {
156157

157-
auto dispatcher = static_cast<const data::mapping::type::__class::Collection::PolymorphicDispatcher*>(type->polymorphicDispatcher);
158+
auto dispatcher = static_cast<const data::type::__class::Collection::PolymorphicDispatcher*>(type->polymorphicDispatcher);
158159
auto collection = dispatcher->createObject();
159160

160161
const Type* itemType = dispatcher->getItemType();

0 commit comments

Comments
 (0)