diff options
Diffstat (limited to 'qt/mssql/date-time/test.hxx')
-rw-r--r-- | qt/mssql/date-time/test.hxx | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/qt/mssql/date-time/test.hxx b/qt/mssql/date-time/test.hxx new file mode 100644 index 0000000..c494efb --- /dev/null +++ b/qt/mssql/date-time/test.hxx @@ -0,0 +1,55 @@ +// file : qt/mssql/date-time/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 <QtCore/QDateTime> + +#include <odb/core.hxx> + +#pragma db object +struct object +{ + bool + operator== (const object& x) const + { + return + id == x.id && + date == x.date && + date_time == x.date_time && + date_time_dt == x.date_time_dt && + date_time_sdt == x.date_time_sdt && + time == x.time; + } + + bool + is_null () const + { + return + date.isNull () && + date_time.isNull () && + date_time_dt.isNull () && + date_time_sdt.isNull () && + time.isNull (); + } + + #pragma db id auto + unsigned long id; + + QDate date; + + QDateTime date_time; + + #pragma db type ("DATETIME") + QDateTime date_time_dt; + + #pragma db type ("SMALLDATETIME") + QDateTime date_time_sdt; + + QTime time; +}; + +#endif // TEST_HXX |