From a9d527ffd7e4a2222d5e80c8110f092af0cb5a74 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 13 Sep 2010 10:42:46 +0200 Subject: Change pragma syntax Change odb pragma namespace to db. Use qualifiers (object, value, and member) to specify type/member name. Add support for mapping C++ types to db types. --- common/auto/test.hxx | 4 ++-- common/lifecycle/test.hxx | 4 ++-- common/query/test.hxx | 10 +++++----- common/schema/test.hxx | 22 +++++++++++----------- common/template/test.hxx | 4 ++-- common/threads/test.hxx | 4 ++-- 6 files changed, 24 insertions(+), 24 deletions(-) (limited to 'common') diff --git a/common/auto/test.hxx b/common/auto/test.hxx index c23027e..8c16a21 100644 --- a/common/auto/test.hxx +++ b/common/auto/test.hxx @@ -10,7 +10,7 @@ #include -#pragma odb object +#pragma db object struct object { object (const std::string& str) @@ -18,7 +18,7 @@ struct object { } - #pragma odb auto id + #pragma db auto id unsigned long id_; std::string str_; diff --git a/common/lifecycle/test.hxx b/common/lifecycle/test.hxx index 268678c..6db1c7e 100644 --- a/common/lifecycle/test.hxx +++ b/common/lifecycle/test.hxx @@ -9,7 +9,7 @@ #include #include -#pragma odb object +#pragma db object struct object { object (unsigned long id) @@ -21,7 +21,7 @@ struct object { } - #pragma odb id + #pragma db id unsigned long id_; std::string str_; }; diff --git a/common/query/test.hxx b/common/query/test.hxx index 59655f6..3d10cc2 100644 --- a/common/query/test.hxx +++ b/common/query/test.hxx @@ -12,7 +12,7 @@ #include -#pragma odb object +#pragma db object struct person { person (unsigned long id, @@ -32,17 +32,17 @@ struct person { } - #pragma odb id + #pragma db id unsigned long id_; - #pragma odb column ("first") + #pragma db column ("first") std::string first_name_; typedef std::auto_ptr string_ptr; // @@ tmp - #pragma odb column ("middle") type ("TEXT") + #pragma db column ("middle") type ("TEXT") string_ptr middle_name_; - #pragma odb column ("last") + #pragma db column ("last") std::string last_name_; unsigned short age_; diff --git a/common/schema/test.hxx b/common/schema/test.hxx index 14c5113..d770d8f 100644 --- a/common/schema/test.hxx +++ b/common/schema/test.hxx @@ -11,29 +11,29 @@ // Table names. // -#pragma odb object table ("TABLE_EXPLICIT") +#pragma db object table ("TABLE_EXPLICIT") struct table_explicit { - #pragma odb id + #pragma db id unsigned long id_; }; -#pragma odb object +#pragma db object struct table_implicit { - #pragma odb id + #pragma db id unsigned long id_; }; // Column names. // -#pragma odb object +#pragma db object struct column { - #pragma odb id + #pragma db id int m1; - #pragma odb column ("foo") + #pragma db column ("foo") int m2; int m_m3; @@ -45,10 +45,10 @@ struct column // Column types. // -#pragma odb object +#pragma db object struct type { - #pragma odb id + #pragma db id std::string id; // Test default C++ to DB type mapping. @@ -69,10 +69,10 @@ struct type double d; std::string str; - #pragma odb type ("INTEGER UNSIGNED") + #pragma db type ("INTEGER UNSIGNED") bool m1; - #pragma odb transient + #pragma db transient char* m2; }; diff --git a/common/template/test.hxx b/common/template/test.hxx index cb25360..1b945a6 100644 --- a/common/template/test.hxx +++ b/common/template/test.hxx @@ -8,7 +8,7 @@ #include -#pragma odb object +#pragma db object struct object { object (unsigned long id) @@ -20,7 +20,7 @@ struct object { } - #pragma odb id + #pragma db id unsigned long id_; }; diff --git a/common/threads/test.hxx b/common/threads/test.hxx index d02fdfd..b9f7777 100644 --- a/common/threads/test.hxx +++ b/common/threads/test.hxx @@ -10,7 +10,7 @@ #include -#pragma odb object +#pragma db object struct object { object (unsigned long id, const std::string& str) @@ -22,7 +22,7 @@ struct object { } - #pragma odb id + #pragma db id unsigned long id_; std::string str_; -- cgit v1.1