diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2012-04-23 17:12:48 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2012-04-23 17:12:48 +0200 |
commit | 2cd5cd2f706d0e76784bc297a02f9d655843f699 (patch) | |
tree | cba541a1ff7adf485c80184d9d8860b41401abec | |
parent | 635d11d74cd873e6f53d05b1d9f091ae112402a5 (diff) |
Assign table prefix to namespace instead of to each class
-rw-r--r-- | common/composite-id/test.hxx | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/common/composite-id/test.hxx b/common/composite-id/test.hxx index a5fb375..00ea972 100644 --- a/common/composite-id/test.hxx +++ b/common/composite-id/test.hxx @@ -72,6 +72,7 @@ operator< (const ncomp& x, const ncomp& y) // Test object with composite id, container. // +#pragma db namespace table("t1_") namespace test1 { #pragma db object @@ -97,6 +98,7 @@ namespace test1 // Test to-one and to-many relationships with composite id as well as // queries and views. // +#pragma db namespace table("t2_") namespace test2 { #pragma db object @@ -201,11 +203,12 @@ namespace test2 // Test one-to-one(i) relationship with composite id. // +#pragma db namespace table("t3_") namespace test3 { struct object2; - #pragma db object table("test3_object1") + #pragma db object struct object1 { object1 () {} @@ -218,7 +221,7 @@ namespace test3 object2* o2; }; - #pragma db object table("test3_object2") + #pragma db object struct object2 { object2 (): o1 (0) {} @@ -244,11 +247,12 @@ namespace test3 // Test many-to-one(i) relationship with composite id. // +#pragma db namespace table("t4_") namespace test4 { struct object2; - #pragma db object table("test4_object1") + #pragma db object struct object1 { object1 () {} @@ -261,7 +265,7 @@ namespace test4 object2* o2; }; - #pragma db object table("test4_object2") + #pragma db object struct object2 { object2 () {} @@ -293,11 +297,12 @@ namespace test4 // Test one-to-many(i) relationship with composite id. // +#pragma db namespace table("t5_") namespace test5 { struct object2; - #pragma db object table("test5_object1") + #pragma db object struct object1 { object1 () {} @@ -309,7 +314,7 @@ namespace test5 object2* o2; }; - #pragma db object table("test5_object2") + #pragma db object struct object2 { object2 () {} @@ -342,11 +347,12 @@ namespace test5 // Test many-to-many(i) relationship with composite id. // +#pragma db namespace table("t6_") namespace test6 { struct object2; - #pragma db object table("test6_object1") + #pragma db object struct object1 { object1 () {} @@ -358,7 +364,7 @@ namespace test6 std::vector<object2*> o2; }; - #pragma db object table("test6_object2") + #pragma db object struct object2 { object2 () {} @@ -391,9 +397,10 @@ namespace test6 // Test object with composite id and version (optimistic concurrency). // +#pragma db namespace table("t7_") namespace test7 { - #pragma db object optimistic table("test7_object") + #pragma db object optimistic struct object { object () {} |