-
Notifications
You must be signed in to change notification settings - Fork 76
Join between classes
Hamed Masafi edited this page Dec 21, 2019
·
2 revisions
NUT_DECLARE_CHILD_TABLE(Score, scores)
In this case scores if of type TableSet. so it should be initialized in constructor.
Post::Post(QObject *parent) : Table(parent),
m_id(0), m_title(""),
m_scores(new TableSet<Score>(this))
{
}
NUT_IMPLEMENT_CHILD_TABLE(Post, Score, scores)
The macro NUT_IMPLEMENT_CHILD_TABLE will be put codes of child class implement
In header:
// Class type key type name read method write method
NUT_FOREIGN_KEY_DECLARE(Post, int, post, post, setPost)
In source:
NUT_FOREIGN_KEY_IMPLEMENT(Score, Post, int, post, post, setPost)
Master class sample:
Slave class sample:
Table of contents