aboutsummaryrefslogtreecommitdiff
path: root/common/inheritance/polymorphism/test15.hxx
blob: f3d3a7fd0c822f3542f20f4121064a34705a9482 (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/inheritance/polymorphism/test15.hxx
// copyright : Copyright (c) 2009-2017 Code Synthesis Tools CC
// license   : GNU GPL v2; see accompanying LICENSE file

#ifndef TEST15_HXX
#define TEST15_HXX

#include <vector>

#include <odb/core.hxx>

#ifdef ODB_COMPILER
#  if defined(ODB_DATABASE_PGSQL)
#    define BLOB_TYPE "BYTEA"
#  elif defined(ODB_DATABASE_MSSQL)
#    define BLOB_TYPE "VARBINARY(max)"
#  else
#    define BLOB_TYPE "BLOB"
#  endif
#endif


// Test LOB/long data and polymorphism.
//
#pragma db namespace table("t15_")
namespace test15
{
  #pragma db object polymorphic
  struct base
  {
    virtual ~base () {}

    #pragma db id auto
    unsigned long id;
  };

  #pragma db object
  struct derived: base
  {
    #pragma db type(BLOB_TYPE)
    std::vector<char> blob;
  };
}

#endif // TEST15_HXX