diff options
Diffstat (limited to 'common/relationship/on-delete/test.hxx')
-rw-r--r-- | common/relationship/on-delete/test.hxx | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/common/relationship/on-delete/test.hxx b/common/relationship/on-delete/test.hxx new file mode 100644 index 0000000..dba04c3 --- /dev/null +++ b/common/relationship/on-delete/test.hxx @@ -0,0 +1,59 @@ +// file : common/relationship/on-delete/test.hxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef TEST_HXX +#define TEST_HXX + +#include <vector> + +#include <odb/core.hxx> + +#pragma db object +struct object +{ + #pragma db id auto + unsigned long id; +}; + +#pragma db object +struct cascade +{ + #pragma db id auto + unsigned long id; + + #pragma db on_delete(cascade) + object* p; +}; + +#pragma db object +struct cascade_cont +{ + #pragma db id auto + unsigned long id; + + #pragma db on_delete(cascade) + std::vector<object*> p; +}; + +#pragma db object +struct set_null +{ + #pragma db id auto + unsigned long id; + + #pragma db on_delete(set_null) + object* p; +}; + +#pragma db object +struct set_null_cont +{ + #pragma db id auto + unsigned long id; + + #pragma db on_delete(set_null) + std::vector<object*> p; +}; + +#endif // TEST_HXX |