fixed object generation on nested objects

This commit is contained in:
Sascha Kühl
2025-12-11 15:41:45 +01:00
parent 571cfd52ae
commit 79c46bbd38
8 changed files with 97 additions and 34 deletions
@@ -29,8 +29,7 @@ private:
public:
template<class Type>
static void complete(const std::shared_ptr<repository_node> &node) {
internal::shadow_repository shadow(node->repo_);
foreign_node_completer<Type> completer(shadow);
foreign_node_completer<Type> completer(internal::shadow_repository(node->repo_));
completer.complete_node(node);
}
@@ -83,7 +82,7 @@ private:
}
template<typename Type>
void attach_node(const std::string &name = "") {
void attach_node(const std::string &name) {
if (repo_.contains(typeid(Type))) {
return;
}
@@ -93,6 +92,18 @@ private:
}
}
template<typename Type>
void attach_node() {
if (repo_.contains(typeid(Type))) {
return;
}
const auto node = repository_node::make_node<Type>(repo_.repo(), "");
if (auto result = repo_.attach_node(node)) {
complete<Type>(result.value());
}
}
template<typename Type>
void attach_relation_node(const std::string &name, const std::string &join_column, const std::string &inverse_join_column) {
using relation_value_type = many_to_many_relation<Type, NodeType>;