blob: aec17c6034affb42497d0398e655ef8f97ba799b (
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
|
// file : common/object/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 <string>
#include <utility> // std::pair
#include <odb/core.hxx>
// Test persistent class template instantiation.
//
#pragma db namespace table("t1_")
namespace test1
{
typedef std::pair<unsigned long, std::string> pair_object;
#pragma db object(pair_object)
#pragma db member(pair_object::first) id auto
#pragma db object abstract
struct base_data
{
#pragma db id auto
unsigned long id;
};
template <typename T>
struct base: base_data
{
T x;
};
typedef base<std::string> base_derived;
#pragma db object(base_derived) abstract
#pragma db object
struct derived: base_derived
{
int n;
};
}
#endif // TEST_HXX
|