diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2012-10-08 14:47:57 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2012-10-08 14:47:57 +0200 |
commit | 6b76715e63d2c265a4c51c73f9019bc578f874cb (patch) | |
tree | c0b5f6a944abf6fe015742bbc08e5a393249cf6d /common/polymorphism/test4.hxx | |
parent | dcee8530bb5c58710a22f50bb92ac7c3b19ddf84 (diff) |
Fix bug in transient inheritance handling
Also test that we can handle it for objects, composite values, and views.
Diffstat (limited to 'common/polymorphism/test4.hxx')
-rw-r--r-- | common/polymorphism/test4.hxx | 76 |
1 files changed, 0 insertions, 76 deletions
diff --git a/common/polymorphism/test4.hxx b/common/polymorphism/test4.hxx deleted file mode 100644 index d9eba86..0000000 --- a/common/polymorphism/test4.hxx +++ /dev/null @@ -1,76 +0,0 @@ -// file : common/polymorphism/test4.hxx -// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC -// license : GNU GPL v2; see accompanying LICENSE file - -#ifndef TEST4_HXX -#define TEST4_HXX - -#include <string> - -#include <odb/core.hxx> - -// Test views. -// -#pragma db namespace table("t4_") -namespace test4 -{ - #pragma db object polymorphic - struct root1 - { - virtual ~root1 () {} - root1 () {} - root1 (unsigned long i): id (i) {} - - #pragma db id - unsigned long id; - }; - - #pragma db object - struct base1: root1 - { - base1 () {} - base1 (unsigned long i, unsigned long n): root1 (i), num (n) {} - - unsigned long num; - }; - - #pragma db object polymorphic - struct root2 - { - virtual ~root2 () {} - root2 () {} - root2 (unsigned long i, unsigned long n): id (i), num (n) {} - - #pragma db id - unsigned long id; - - unsigned long num; - }; - - #pragma db object - struct base2: root2 - { - base2 () {} - base2 (unsigned long i, unsigned long n, const std::string& s) - : root2 (i, n), str (s) {} - - std::string str; - }; - - // Test custom join condition. - // - #pragma db view object(base2) object(base1: base2::num == base1::num) - struct view1 - { - std::string str; - }; - - #pragma db view object(base2) - struct view2 - { - #pragma db column("min(" + base2::num + ")") - std::size_t min_num; - }; -} - -#endif // TEST4_HXX |