logger fixes

This commit is contained in:
Sascha Kühl
2026-02-04 15:13:27 +01:00
parent 520b2bab49
commit 1a1ecd1613
8 changed files with 48 additions and 32 deletions
@@ -73,9 +73,8 @@ public:
template<class CollectionType>
void on_has_many(const char * /*id*/, CollectionType &cont, const char *join_column, const utils::foreign_attributes &attr, std::enable_if_t<object::is_object_ptr<typename CollectionType::value_type>::value> * = nullptr);
template<class CollectionType>
void on_has_many(const char * /*id*/, CollectionType &, const char * /*join_column*/, const utils::foreign_attributes &/*attr*/, std::enable_if_t<!object::is_object_ptr<typename CollectionType::value_type>::value> * = nullptr) {
}
template<class CollectionType>
void on_has_many(const char * /*id*/, CollectionType &, const char * /*join_column*/, const utils::foreign_attributes &/*attr*/, std::enable_if_t<!object::is_object_ptr<typename CollectionType::value_type>::value> * = nullptr);
template <class CollectionType>
void on_has_many_to_many(const char *id, CollectionType &, const char * /*join_column*/, const char * /*inverse_join_column*/, const utils::foreign_attributes &attr);
template<class CollectionType>
void on_has_many_to_many(const char *, CollectionType &, const utils::foreign_attributes &attr);
@@ -158,6 +157,25 @@ void query_result_impl::on_has_many(const char *, CollectionType &cont, const ch
}
}
}
template <class CollectionType>
void query_result_impl::on_has_many(const char *id, CollectionType &cont, const char *join_column, const utils::foreign_attributes &attr, std::enable_if_t<!object::is_object_ptr<typename CollectionType::value_type>::value> *) {
using value_type = typename CollectionType::value_type;
auto object_resolver = resolver_->object_resolver<value_type>();
auto resolver = resolver_->collection_resolver<typename CollectionType::value_type>(result_type_, join_column);
if (attr.fetch() == utils::fetch_type::Lazy) {
cont.reset(std::make_shared<object::collection_proxy<typename CollectionType::value_type>>(resolver, current_pk_));
} else {
if (initialized_collections_.insert({result_type_, typeid(typename CollectionType::value_type), std::string{join_column}}).second) {
cont.reset(std::make_shared<object::collection_proxy<typename CollectionType::value_type>>(resolver, std::vector<typename CollectionType::value_type>()));
}
// read a single value
value_type value;
utils::data_type_traits<value_type>::read_value(*reader_, id, column_index_++, value, sizeof(value_type));
cont.push_back(value);
}
}
template <class CollectionType>
void query_result_impl::on_has_many_to_many(const char *id, CollectionType &cont, const char *join_column, const char *, const utils::foreign_attributes &attr) {