diff options
Diffstat (limited to 'view/driver.cxx')
-rw-r--r-- | view/driver.cxx | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/view/driver.cxx b/view/driver.cxx index 74d6eed..d975cc4 100644 --- a/view/driver.cxx +++ b/view/driver.cxx @@ -314,6 +314,28 @@ main (int argc, char* argv[]) t.commit (); } + // Get the list of employers that have any employees. + // + { + typedef odb::result<employer_with_employees> result; + + shared_ptr<employer> es (new employer (3, "Empty Shell LLC")); + + transaction t (db->begin ()); + db->persist (es); + + result r (db->query<employer_with_employees> ()); + + cout << "Employers with employees" << endl; + + for (result::iterator i (r.begin ()); i != r.end (); ++i) + cout << " " << i->e->name () << endl; + + cout << endl; + + db->erase (es); + t.commit (); + } // Get the list of employees that have accumulated vacation days. // |