aboutsummaryrefslogtreecommitdiff
path: root/qt/mysql/core/test.hxx
blob: cc8e02d0680b0cb5b1c85062c8a4756f03eea6f3 (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
// file      : qt/mysql/core/test.hxx
// author    : Constantin Michael <constantin@codesynthesis.com>
// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC
// license   : GNU GPL v2; see accompanying LICENSE file

#ifndef TEST_HXX
#define TEST_HXX

#include <QString>
#include <QDateTime>

#pragma db object
struct time_punchcard
{
  #pragma db id auto
  unsigned long id;

  QDateTime date_time;
};

#pragma db object
struct person
{
  bool
  operator== (const person& x) const
  {
    return name == x.name &&
      date_of_birth == x.date_of_birth &&
      time_of_birth == x.time_of_birth;
  }

  #pragma db id
  QString name;

  #pragma db type("DATE NOT NULL")
  QDate date_of_birth;
  QTime time_of_birth;
};

#endif // TEST_HXX