added pk information to class object
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#include "matador/object/attribute_generator.hpp"
|
||||
#include "matador/object/repository.hpp"
|
||||
#include "matador/object/object.hpp"
|
||||
|
||||
namespace matador::object {
|
||||
|
||||
@@ -21,4 +22,8 @@ void attribute_generator::insert_missing_reference_column(const std::type_index&
|
||||
const_cast<repository&>(repo_).missing_references_.insert({ti, ref_column});
|
||||
}
|
||||
|
||||
void attribute_generator::prepare_primary_key(attribute& ref, utils::identifier &&pk) const {
|
||||
obj_.pk_attribute_ = &ref;
|
||||
obj_.pk_identifier_ = std::move(pk);
|
||||
}
|
||||
}
|
||||
@@ -21,6 +21,18 @@ void object::add_constraint( class constraint c ) {
|
||||
ref.owner_ = this;
|
||||
}
|
||||
|
||||
const attribute* object::primary_key_attribute() const {
|
||||
return pk_attribute_;
|
||||
}
|
||||
|
||||
const utils::identifier& object::primary_key() const {
|
||||
return pk_identifier_;
|
||||
}
|
||||
|
||||
bool object::has_primary_key() const {
|
||||
return pk_attribute_ != nullptr;
|
||||
}
|
||||
|
||||
const std::string& object::name() const {
|
||||
return name_;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user