diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2021-12-09 15:47:34 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2021-12-09 15:47:34 +0300 |
commit | d259750511b3c2aaeace49f8ccb1d7f3ad561452 (patch) | |
tree | 9a98e1a2a66fc8a25dc1b58efd2e7e0e77201914 /libbrep/package.hxx | |
parent | 4bc9390c48cee736917ead5d20aa216fe10bae47 (diff) |
Prepare for supporting multiple ids in requirement alternative
Diffstat (limited to 'libbrep/package.hxx')
-rw-r--r-- | libbrep/package.hxx | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/libbrep/package.hxx b/libbrep/package.hxx index 1927298..38ca0ec 100644 --- a/libbrep/package.hxx +++ b/libbrep/package.hxx @@ -607,15 +607,36 @@ namespace brep // requirements // - #pragma db member(requirement_key::outer) column("requirement_index") - #pragma db member(requirement_key::inner) column("index") + // Note that this is a 2-level nested container which is mapped to three + // container tables each containing data of each dimension. + // Container of the requirement_alternatives values. + // #pragma db member(requirements) id_column("") value_column("") + + // Container of the requirement_alternative values. + // + #pragma db member(requirement_alternative_key::outer) column("requirement_index") + #pragma db member(requirement_alternative_key::inner) column("index") + #pragma db member(requirement_alternatives) \ virtual(requirement_alternatives_map) \ after(requirements) \ get(odb::nested_get (this.requirements)) \ set(odb::nested_set (this.requirements, std::move (?))) \ + id_column("") key_column("") value_column("") + + // Container of the requirement (string) values. + // + #pragma db member(requirement_key::outer) column("requirement_index") + #pragma db member(requirement_key::middle) column("alternative_index") + #pragma db member(requirement_key::inner) column("index") + + #pragma db member(requirement_alternative_requirements) \ + virtual(requirement_alternative_requirements_map) \ + after(requirement_alternatives) \ + get(odb::nested2_get (this.requirements)) \ + set(odb::nested2_set (this.requirements, std::move (?))) \ id_column("") key_column("") value_column("id") // tests |