This commit is contained in:
parent
01614a2b3c
commit
d0fb2803b8
|
|
@ -84,6 +84,10 @@ public: \
|
||||||
NUT_WRAP_NAMESPACE(TableSet)<type*> *n(){ \
|
NUT_WRAP_NAMESPACE(TableSet)<type*> *n(){ \
|
||||||
return m_##n; \
|
return m_##n; \
|
||||||
}
|
}
|
||||||
|
//static type *n##Table(){ \
|
||||||
|
// /*static type *f = new type();*/ \
|
||||||
|
// /*return f;*/ \
|
||||||
|
//} \
|
||||||
|
|
||||||
#define NUT_INDEX(name, field, order)
|
#define NUT_INDEX(name, field, order)
|
||||||
#define NUT_PRIMARY_KEY(x) Q_CLASSINFO(QT_STRINGIFY(__nut_NAME_PERFIX #x " " __nut_PRIMARY_KEY), #x)
|
#define NUT_PRIMARY_KEY(x) Q_CLASSINFO(QT_STRINGIFY(__nut_NAME_PERFIX #x " " __nut_PRIMARY_KEY), #x)
|
||||||
|
|
|
||||||
|
|
@ -62,15 +62,15 @@ public:
|
||||||
template<class T>
|
template<class T>
|
||||||
Q_OUTOFLINE_TEMPLATE TableSet<T>::TableSet(Database *parent) : TableSetBase(parent)
|
Q_OUTOFLINE_TEMPLATE TableSet<T>::TableSet(Database *parent) : TableSetBase(parent)
|
||||||
{
|
{
|
||||||
auto t = new QMetaType(qRegisterMetaType<T>());
|
// auto t = new QMetaType(qRegisterMetaType<T>());
|
||||||
_childClassName = t->metaObject()->className();
|
// _childClassName = t->metaObject()->className();
|
||||||
}
|
}
|
||||||
|
|
||||||
template<class T>
|
template<class T>
|
||||||
Q_OUTOFLINE_TEMPLATE TableSet<T>::TableSet(Table *parent) : TableSetBase(parent)
|
Q_OUTOFLINE_TEMPLATE TableSet<T>::TableSet(Table *parent) : TableSetBase(parent)
|
||||||
{
|
{
|
||||||
auto t = new QMetaType(qRegisterMetaType<T>());
|
// auto t = new QMetaType(qRegisterMetaType<T>());
|
||||||
_childClassName = t->metaObject()->className();
|
// _childClassName = t->metaObject()->className();
|
||||||
}
|
}
|
||||||
|
|
||||||
template<class T>
|
template<class T>
|
||||||
|
|
|
||||||
|
|
@ -16,12 +16,12 @@
|
||||||
|
|
||||||
MainTest::MainTest(QObject *parent) : QObject(parent)
|
MainTest::MainTest(QObject *parent) : QObject(parent)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainTest::initTestCase()
|
void MainTest::initTestCase()
|
||||||
{
|
{
|
||||||
qDebug() << "User type id:" << qRegisterMetaType<Post*>();
|
qDebug() << "User type id:" << qRegisterMetaType<User*>();
|
||||||
|
qDebug() << "Post type id:" << qRegisterMetaType<Post*>();
|
||||||
qDebug() << "Comment type id:" << qRegisterMetaType<Comment*>();
|
qDebug() << "Comment type id:" << qRegisterMetaType<Comment*>();
|
||||||
qDebug() << "DB type id:" << qRegisterMetaType<WeblogDatabase*>();
|
qDebug() << "DB type id:" << qRegisterMetaType<WeblogDatabase*>();
|
||||||
|
|
||||||
|
|
@ -96,7 +96,7 @@ void MainTest::createPost2()
|
||||||
void MainTest::selectPosts()
|
void MainTest::selectPosts()
|
||||||
{
|
{
|
||||||
auto q = db.posts()->query();
|
auto q = db.posts()->query();
|
||||||
q->join(Post::commentsTable());
|
// q->join(Post::commentsTable());
|
||||||
q->orderBy(!Post::saveDateField() & Post::bodyField());
|
q->orderBy(!Post::saveDateField() & Post::bodyField());
|
||||||
q->setWhere(Post::idField() == postId);
|
q->setWhere(Post::idField() == postId);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue