aboutsummaryrefslogtreecommitdiff
path: root/common/relationship-query
diff options
context:
space:
mode:
Diffstat (limited to 'common/relationship-query')
-rw-r--r--common/relationship-query/driver.cxx4
-rw-r--r--common/relationship-query/test.hxx9
2 files changed, 9 insertions, 4 deletions
diff --git a/common/relationship-query/driver.cxx b/common/relationship-query/driver.cxx
index 58bbef5..ed96223 100644
--- a/common/relationship-query/driver.cxx
+++ b/common/relationship-query/driver.cxx
@@ -39,8 +39,8 @@ main (int argc, char* argv[])
shared_ptr<country> us (new country ("US", "United States"));
shared_ptr<country> se (new country ("SE", "Sweden"));
- shared_ptr<employer> st (new employer ("Simple Tech, Inc"));
- shared_ptr<employer> ct (new employer ("Complex Tech, Inc"));
+ shared_ptr<employer> st (new employer ("Simple Tech, Inc", ca));
+ shared_ptr<employer> ct (new employer ("Complex Tech, Inc", us));
// person
//
diff --git a/common/relationship-query/test.hxx b/common/relationship-query/test.hxx
index c2e167c..671c849 100644
--- a/common/relationship-query/test.hxx
+++ b/common/relationship-query/test.hxx
@@ -111,8 +111,8 @@ struct employee: person
#pragma db object pointer(shared_ptr)
struct employer
{
- employer (const std::string& n)
- : name (n)
+ employer (const std::string& n, shared_ptr<country> nat)
+ : name (n), nationality (nat)
{
}
@@ -122,6 +122,11 @@ struct employer
#pragma db id
std::string name;
+
+ // The same member name and type as in person (test JOIN alias).
+ //
+ #pragma db not_null
+ shared_ptr<country> nationality;
};
#pragma db object pointer(shared_ptr)