added pk information to class object
This commit is contained in:
@@ -6,6 +6,8 @@
|
||||
#include "matador/object/constraint.hpp"
|
||||
#include "matador/object/constraints_generator.hpp"
|
||||
|
||||
#include "matador/utils/identifier.hpp"
|
||||
|
||||
namespace matador::object {
|
||||
|
||||
class repository;
|
||||
@@ -27,6 +29,10 @@ public:
|
||||
void add_attribute(attribute attr);
|
||||
void add_constraint(class constraint c);
|
||||
|
||||
[[nodiscard]] const attribute* primary_key_attribute() const;
|
||||
[[nodiscard]] const utils::identifier& primary_key() const;
|
||||
[[nodiscard]] bool has_primary_key() const;
|
||||
|
||||
[[nodiscard]] const std::string& name() const;
|
||||
[[nodiscard]] const std::string& alias() const;
|
||||
|
||||
@@ -40,10 +46,13 @@ public:
|
||||
|
||||
private:
|
||||
friend class constraints_generator;
|
||||
friend class attribute_generator;
|
||||
|
||||
std::string name_;
|
||||
std::string alias_;
|
||||
|
||||
attribute* pk_attribute_{nullptr};
|
||||
utils::identifier pk_identifier_;
|
||||
std::vector<attribute> attributes_;
|
||||
std::vector<class constraint> constraints_;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user