From 5d60da7c563025101a7a94012bb0facf88add351 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sun, 2 Oct 2011 16:21:47 +0200 Subject: Add simple view to hello example --- hello/person.hxx | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'hello/person.hxx') diff --git a/hello/person.hxx b/hello/person.hxx index 69b1878..f480723 100644 --- a/hello/person.hxx +++ b/hello/person.hxx @@ -6,6 +6,7 @@ #define PERSON_HXX #include +#include // std::size_t #include @@ -57,4 +58,17 @@ private: unsigned short age_; }; +#pragma db view object(person) +struct person_stat +{ + #pragma db column("count(" + person::id_ + ")") + std::size_t count; + + #pragma db column("min(" + person::age_ + ")") + unsigned short min_age; + + #pragma db column("max(" + person::age_ + ")") + unsigned short max_age; +}; + #endif // PERSON_HXX -- cgit v1.1