fixed object generation on nested objects
This commit is contained in:
@@ -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>;
|
||||
|
||||
Reference in New Issue
Block a user