added date_type_t, time_type_t and timestamp, ensure allocated postgres resources are released, split repository into basic_repository and repository.
This commit is contained in:
@@ -3,10 +3,10 @@
|
||||
#include "matador/object/repository_node.hpp"
|
||||
|
||||
namespace matador::object {
|
||||
relation_endpoint::relation_endpoint(std::string field_name, const relation_type type, const std::shared_ptr<repository_node> &node)
|
||||
relation_endpoint::relation_endpoint(std::string field_name, const relation_type type, repository_node &node)
|
||||
: field_name_(std::move(field_name))
|
||||
, type_(type)
|
||||
, node_(node) {
|
||||
, node_(&node) {
|
||||
}
|
||||
|
||||
std::string relation_endpoint::field_name() const {
|
||||
@@ -25,10 +25,6 @@ const repository_node &relation_endpoint::node() const {
|
||||
return *node_;
|
||||
}
|
||||
|
||||
std::shared_ptr<repository_node> relation_endpoint::node_ptr() const {
|
||||
return node_;
|
||||
}
|
||||
|
||||
bool relation_endpoint::is_has_one() const {
|
||||
return type_ == relation_type::HasOne;
|
||||
}
|
||||
@@ -42,7 +38,7 @@ bool relation_endpoint::is_belongs_to() const {
|
||||
}
|
||||
|
||||
std::shared_ptr<relation_endpoint> relation_endpoint::foreign_endpoint() const {
|
||||
return foreign_endpoint_;
|
||||
return foreign_endpoint_.lock();
|
||||
}
|
||||
|
||||
void relation_endpoint::link_foreign_endpoint( const std::shared_ptr<relation_endpoint>& endpoint ) {
|
||||
|
||||
Reference in New Issue
Block a user