diff options
34 files changed, 52 insertions, 63 deletions
diff --git a/boost/common/optional/makefile b/boost/common/optional/makefile index 6145a2d..ca0a94d 100644 --- a/boost/common/optional/makefile +++ b/boost/common/optional/makefile @@ -46,7 +46,7 @@ $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) \ --profile boost/optional --generate-schema --generate-query \ ---table-prefix boost_common_optional_ +--table-prefix boost_optional_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ $(boost.l.cpp-options) diff --git a/boost/common/smart-ptr/makefile b/boost/common/smart-ptr/makefile index 6d875db..79c943a 100644 --- a/boost/common/smart-ptr/makefile +++ b/boost/common/smart-ptr/makefile @@ -46,7 +46,7 @@ $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) \ --profile boost/smart-ptr --generate-schema \ ---table-prefix boost_common_smart_ptr_ +--table-prefix boost_smart_ptr_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ $(boost.l.cpp-options) diff --git a/boost/common/template/makefile b/boost/common/template/makefile index eb2c5f6..8fe2fa6 100644 --- a/boost/common/template/makefile +++ b/boost/common/template/makefile @@ -46,7 +46,7 @@ $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) \ --profile boost/version --generate-schema \ ---table-prefix boost_common_template_ #@@ CHANGE table prefix, boost/version +--table-prefix boost_template_ #@@ CHANGE table prefix, boost/version $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ $(boost.l.cpp-options) diff --git a/boost/common/unordered/makefile b/boost/common/unordered/makefile index 0dd69de..7ea4e60 100644 --- a/boost/common/unordered/makefile +++ b/boost/common/unordered/makefile @@ -46,7 +46,7 @@ $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) \ --profile boost/unordered --generate-schema \ ---table-prefix boost_common_unordered_ +--table-prefix boost_unordered_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) $(odb_boost.l.cpp-options) \ $(boost.l.cpp-options) diff --git a/common/auto/makefile b/common/auto/makefile index 1880cba..da798c6 100644 --- a/common/auto/makefile +++ b/common/auto/makefile @@ -36,7 +36,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---table-prefix cmn_auto_ +--table-prefix auto_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/common/callback/driver.cxx b/common/callback/driver.cxx index bc5b4f0..5f2c258 100644 --- a/common/callback/driver.cxx +++ b/common/callback/driver.cxx @@ -94,7 +94,7 @@ main (int argc, char* argv[]) transaction t (db->begin ()); result r (db->query<object> ( - (query::id < 3) + "ORDER BY common_callback_object.id")); + (query::id < 3) + "ORDER BY callback_object.id")); for (result::iterator i (r.begin ()); i != r.end (); ++i) { diff --git a/common/callback/makefile b/common/callback/makefile index b24b9ae..6dca289 100644 --- a/common/callback/makefile +++ b/common/callback/makefile @@ -36,7 +36,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---generate-query --table-prefix common_callback_ +--generate-query --table-prefix callback_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/common/composite/makefile b/common/composite/makefile index 9c4a29d..1813080 100644 --- a/common/composite/makefile +++ b/common/composite/makefile @@ -36,7 +36,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---generate-query --table-prefix common_composite_ +--generate-query --table-prefix composite_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/common/const/makefile b/common/const/makefile index d8a1410..fd55611 100644 --- a/common/const/makefile +++ b/common/const/makefile @@ -36,7 +36,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---generate-query --table-prefix common_const_ +--generate-query --table-prefix const_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/common/container/makefile b/common/container/makefile index c1b1124..51dd456 100644 --- a/common/container/makefile +++ b/common/container/makefile @@ -36,7 +36,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---table-prefix cmn_ctnr_ +--table-prefix container_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/common/container/test.hxx b/common/container/test.hxx index ec392ec..2e267f6 100644 --- a/common/container/test.hxx +++ b/common/container/test.hxx @@ -54,7 +54,6 @@ struct cont_comp1 { // This composite value does not have any columns. // - #pragma db id_column("obj_id") num_vector sv; // Have the name "conflic" with the one in the object. }; @@ -64,14 +63,11 @@ struct cont_comp2 cont_comp2 (): num (777), str ("ggg") {} int num; - - #pragma db id_column("obj_id") str_list sl; - std::string str; }; -#pragma db object table("obj") +#pragma db object struct object { object (): nv (comp1_.sv), sl (comp2_.sl) {} diff --git a/common/ctor/makefile b/common/ctor/makefile index 8271074..98e9e3a 100644 --- a/common/ctor/makefile +++ b/common/ctor/makefile @@ -36,7 +36,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---generate-query --table-prefix common_ctor_ +--generate-query --table-prefix ctor_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/common/default/driver.cxx b/common/default/driver.cxx index a47051c..846619b 100644 --- a/common/default/driver.cxx +++ b/common/default/driver.cxx @@ -33,7 +33,7 @@ main (int argc, char* argv[]) // { transaction t (db->begin ()); - db->execute ("INSERT INTO common_default_object (obj_id) VALUES (1)"); + db->execute ("INSERT INTO default_object (obj_id) VALUES (1)"); t.commit (); } diff --git a/common/default/makefile b/common/default/makefile index ce5f9e9..2f66e7a 100644 --- a/common/default/makefile +++ b/common/default/makefile @@ -36,7 +36,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---generate-query --table-prefix common_default_ +--generate-query --table-prefix default_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/common/enum/makefile b/common/enum/makefile index 03c4915..bbfb1e1 100644 --- a/common/enum/makefile +++ b/common/enum/makefile @@ -36,7 +36,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---generate-query --table-prefix common_enum_ +--generate-query --table-prefix enum_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/common/erase-query/driver.cxx b/common/erase-query/driver.cxx index baa66f4..0b2d7f5 100644 --- a/common/erase-query/driver.cxx +++ b/common/erase-query/driver.cxx @@ -64,7 +64,7 @@ main (int argc, char* argv[]) { transaction t (db->begin ()); assert (db->erase_query<object> ( - "common_erase_query_object.id < 3") == 2); + "erase_query_object.id < 3") == 2); db->erase_query<object> (); t.commit (); } @@ -162,7 +162,7 @@ main (int argc, char* argv[]) #ifndef DATABASE_MYSQL { transaction t (db->begin ()); - assert (db->execute ("SELECT * FROM common_erase_query_object_v " + assert (db->execute ("SELECT * FROM erase_query_object_v " "WHERE object_id = 1") == 0); t.commit (); } diff --git a/common/erase-query/makefile b/common/erase-query/makefile index 27ac281..4ea31a2 100644 --- a/common/erase-query/makefile +++ b/common/erase-query/makefile @@ -36,7 +36,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---generate-query --table-prefix common_erase_query_ +--generate-query --table-prefix erase_query_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/common/inheritance/makefile b/common/inheritance/makefile index 8afa961..47ffcaa 100644 --- a/common/inheritance/makefile +++ b/common/inheritance/makefile @@ -36,7 +36,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---generate-query --table-prefix common_inheritance_ +--generate-query --table-prefix inheritance_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/common/inverse/makefile b/common/inverse/makefile index 08c02e9..6b33f10 100644 --- a/common/inverse/makefile +++ b/common/inverse/makefile @@ -36,7 +36,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---generate-query --table-prefix common_inverse_ +--generate-query --table-prefix inverse_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/common/lazy-ptr/makefile b/common/lazy-ptr/makefile index 45a6779..d11a87b 100644 --- a/common/lazy-ptr/makefile +++ b/common/lazy-ptr/makefile @@ -36,7 +36,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---table-prefix cmn_lazy_ptr_ +--table-prefix lazy_ptr_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/common/lifecycle/makefile b/common/lifecycle/makefile index 3fcafce..d1cd9ad 100644 --- a/common/lifecycle/makefile +++ b/common/lifecycle/makefile @@ -36,7 +36,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---table-prefix cmn_lifecycle_ +--table-prefix lifecycle_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/common/relationship-query/makefile b/common/relationship-query/makefile index f422a8a..2097823 100644 --- a/common/relationship-query/makefile +++ b/common/relationship-query/makefile @@ -36,7 +36,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---generate-query --table-prefix common_relationship_query_ +--generate-query --table-prefix relationship_query_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/common/relationship/makefile b/common/relationship/makefile index fa00a78..d9f77e6 100644 --- a/common/relationship/makefile +++ b/common/relationship/makefile @@ -36,7 +36,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---generate-query --table-prefix common_relationship_ +--generate-query --table-prefix relationship_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/common/schema/makefile b/common/schema/makefile index e6e36e9..bc04d16 100644 --- a/common/schema/makefile +++ b/common/schema/makefile @@ -36,7 +36,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---table-prefix cmn_schema_ +--table-prefix schema_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/common/template/makefile b/common/template/makefile index eec13b5..820fcb3 100644 --- a/common/template/makefile +++ b/common/template/makefile @@ -36,7 +36,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---table-prefix common_template_ #@@ CHANGE THIS +--table-prefix template_ #@@ CHANGE THIS $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/common/threads/makefile b/common/threads/makefile index dd07155..e9aef66 100644 --- a/common/threads/makefile +++ b/common/threads/makefile @@ -36,7 +36,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---generate-query --table-prefix common_threads_ +--generate-query --table-prefix threads_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/common/view/driver.cxx b/common/view/driver.cxx index a6048dd..8d62830 100644 --- a/common/view/driver.cxx +++ b/common/view/driver.cxx @@ -301,7 +301,7 @@ main (int argc, char* argv[]) result r ( db->query<view1c> ( "SELECT first, last, age " - "FROM common_view_person " + "FROM view_person " "WHERE age < 31 ORDER BY age")); view1_check (r); diff --git a/common/view/makefile b/common/view/makefile index 098baeb..24f60bf 100644 --- a/common/view/makefile +++ b/common/view/makefile @@ -36,7 +36,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---generate-query --table-prefix common_view_ +--generate-query --table-prefix view_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/common/view/test.hxx b/common/view/test.hxx index 3812662..103439d 100644 --- a/common/view/test.hxx +++ b/common/view/test.hxx @@ -130,7 +130,7 @@ struct employer // Complete suffix query template. // -#pragma db view query("SELECT first, last, age FROM common_view_person") +#pragma db view query("SELECT first, last, age FROM view_person") struct view1 { std::string first; @@ -141,7 +141,7 @@ struct view1 // Complete query. // #pragma db view query("SELECT first, last, age " \ - "FROM common_view_person " \ + "FROM view_person " \ "WHERE age < 31 ORDER BY age") struct view1a { @@ -153,7 +153,7 @@ struct view1a // Complete placeholder query template. // #pragma db view query("SELECT first, last, age " \ - "FROM common_view_person " \ + "FROM view_person " \ "WHERE age < 31 AND (?) ORDER BY age") struct view1b { @@ -174,7 +174,7 @@ struct view1c // Assembled SELECT and FROM-lists. // -#pragma db view table("common_view_person") +#pragma db view table("view_person") struct view1d { #pragma db column("first") @@ -194,7 +194,7 @@ struct view1d // Complete suffix query. // #pragma db view object(person) \ - query("SELECT count(id) FROM common_view_person") + query("SELECT count(id) FROM view_person") struct view2 { std::size_t count; @@ -214,7 +214,7 @@ struct view2a #pragma db view object(person) struct view2b { - #pragma db column("count(common_view_person.id)") + #pragma db column("count(view_person.id)") std::size_t count; }; @@ -235,7 +235,7 @@ struct view2c // #pragma db view object(person = test) \ query("SELECT last, count(last) " \ - "FROM common_view_person " \ + "FROM view_person " \ "GROUP BY last") struct view3 { @@ -265,9 +265,9 @@ struct view3a // #pragma db view object(person) object(country = residence) \ query("SELECT first, last, residence.name " \ - "FROM common_view_person " \ - "LEFT JOIN common_view_country AS residence " \ - "ON common_view_person.residence = residence.code") + "FROM view_person " \ + "LEFT JOIN view_country AS residence " \ + "ON view_person.residence = residence.code") struct view4 { std::string first_name; @@ -347,9 +347,9 @@ struct view6b // The same using tables. // -#pragma db view table("common_view_person" = "p") \ - table("common_view_employer_employees" = "ee": "ee.value = p.id") \ - table("common_view_employer" = "e": "ee.object_id = e.name") +#pragma db view table("view_person" = "p") \ + table("view_employer_employees" = "ee": "ee.value = p.id") \ + table("view_employer" = "e": "ee.object_id = e.name") struct view6c { #pragma db column("p.first") diff --git a/common/wrapper/makefile b/common/wrapper/makefile index 7cb4171..a6c82b1 100644 --- a/common/wrapper/makefile +++ b/common/wrapper/makefile @@ -36,7 +36,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ ---table-prefix cmn_wpr_ +--table-prefix wrapper_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) diff --git a/common/wrapper/test.hxx b/common/wrapper/test.hxx index 70bb682..baf6346 100644 --- a/common/wrapper/test.hxx +++ b/common/wrapper/test.hxx @@ -39,17 +39,17 @@ struct object std::auto_ptr<int> num; + #pragma db null std::auto_ptr<std::string> str; - nullable_string nstr; - #pragma db id_column ("id") + nullable_string nstr; std::vector<nullable_string> nstrs; #ifdef HAVE_TR1_MEMORY #pragma db null tr1_nullable_string tr1_str; - #pragma db value_null id_column("id") + #pragma db value_null std::vector<tr1_nullable_string> tr1_strs; #endif }; @@ -84,7 +84,6 @@ struct comp2 std::string str; int num; - #pragma db id_column("id") index_column("i") std::vector<std::string> strs; }; @@ -94,17 +93,14 @@ operator== (const comp2& x, const comp2& y) return x.str == y.str && x.num == y.num && x.strs == y.strs; } -#pragma db object table("comp_obj") +#pragma db object struct comp_object { #pragma db id auto unsigned long id_; std::auto_ptr<comp1> c1; // Wrapped comp value. - - #pragma db id_column("id") index_column("i") std::vector<nullable<comp1> > vc1; // Container of wrapped comp values. - std::auto_ptr<comp2> c2; // Container inside wrapped comp value. }; @@ -114,12 +110,10 @@ struct comp_object struct comp3: comp2 { std::auto_ptr<comp1> c1; - - #pragma db id_column("id") index_column("i") std::vector<nullable<comp1> > vc1; }; -#pragma db object table("comp_obj2") +#pragma db object struct comp_object2 { #pragma db id auto @@ -136,7 +130,6 @@ struct comp_object2 struct cont_comp { int num; - #pragma db id_column("id") std::auto_ptr<std::vector<std::string> > strs; }; @@ -146,7 +139,7 @@ operator== (const cont_comp& x, const cont_comp& y) return x.num == y.num && *x.strs == *y.strs; } -#pragma db object table("cont_obj") +#pragma db object struct cont_object { #pragma db id auto diff --git a/qt/common/containers/makefile b/qt/common/containers/makefile index f675c37..c95a1a6 100644 --- a/qt/common/containers/makefile +++ b/qt/common/containers/makefile @@ -46,7 +46,7 @@ $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) \ --profile qt/containers --profile qt/basic --generate-schema \ ---table-prefix qt_common_containers_ +--table-prefix qt_containers_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) $(odb_qt.l.cpp-options) \ $(qt_core.l.cpp-options) diff --git a/qt/common/smart-ptr/makefile b/qt/common/smart-ptr/makefile index 21ba8b8..12514f7 100644 --- a/qt/common/smart-ptr/makefile +++ b/qt/common/smart-ptr/makefile @@ -45,7 +45,7 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) \ ---profile qt/smart-ptr --generate-schema --table-prefix qt_common_smart_ptr_ +--profile qt/smart-ptr --generate-schema --table-prefix qt_smart_ptr_ $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) $(odb_qt.l.cpp-options) \ $(qt_core.l.cpp-options) diff --git a/qt/common/template/makefile b/qt/common/template/makefile index d0cb3d8..84a63eb 100644 --- a/qt/common/template/makefile +++ b/qt/common/template/makefile @@ -46,7 +46,7 @@ $(gen): $(odb) $(gen): odb := $(odb) $(gen) $(dist): export odb_options += --database $(db_id) \ --profile qt/version --generate-schema \ ---table-prefix qt_common_template_ #@@ CHANGE table prefix, qt/version +--table-prefix qt_template_ #@@ CHANGE table prefix, qt/version $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) $(odb_qt.l.cpp-options) \ $(qt_core.l.cpp-options) |