aboutsummaryrefslogtreecommitdiff
path: root/common/relationship/on-delete/test.hxx
blob: a6471624d99ab9cdde1238c209605e9e4c3e975c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
// file      : common/relationship/on-delete/test.hxx
// copyright : Copyright (c) 2009-2018 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