aboutsummaryrefslogtreecommitdiff
path: root/common/polymorphism/test.hxx
diff options
context:
space:
mode:
Diffstat (limited to 'common/polymorphism/test.hxx')
-rw-r--r--common/polymorphism/test.hxx13
1 files changed, 8 insertions, 5 deletions
diff --git a/common/polymorphism/test.hxx b/common/polymorphism/test.hxx
index d0a6ed5..9994fdd 100644
--- a/common/polymorphism/test.hxx
+++ b/common/polymorphism/test.hxx
@@ -984,7 +984,7 @@ namespace test11
};
}
-// Test polymorphic classes with auto id.
+// Test polymorphic classes with private auto id.
//
#pragma db namespace table("t12_")
namespace test12
@@ -994,17 +994,20 @@ namespace test12
{
virtual ~root () = 0; // Auto-abstract.
- #pragma db id auto
- unsigned long id;
-
virtual bool
compare (const root& r, bool tc = true) const
{
if (tc && typeid (r) != typeid (root))
return false;
- return id == r.id;
+ return id_ == r.id_;
}
+
+ unsigned long id () const {return id_;}
+ void id (unsigned long id) {id_ = id;}
+ private:
+ #pragma db id auto access(id)
+ unsigned long id_;
};
inline root::