Revision df1e56bd
Von Christian Ehringfeld vor fast 9 Jahren hinzugefügt
samples/example/main.cpp | ||
---|---|---|
QSharedPointer<Group> gPtr = QSharedPointer<Group>(g);
|
||
e->createTable(gPtr);
|
||
QSharedPointer<Entity> groupPtr = gPtr.objectCast<Entity>();
|
||
QSharedPointer<Person> mainTeacher = QSharedPointer<Person>(new Person("Max",
|
||
"Mustermann", Person::Gender::MALE));
|
||
gPtr->setMainTeacher(mainTeacher);
|
||
//Persons will also persisted
|
||
e->create(groupPtr, true, true);
|
||
|
||
|
||
/** ---------------------------------
|
||
* FIND
|
||
* ---------------------------------
|
||
... | ... | |
qDebug() << "GroupID:" << groupFindPtr->getId();
|
||
QSharedPointer<Group> grp = groupFindPtr.objectCast<Group>();
|
||
qDebug() << "PersonSize:" << grp->getPersons().size();
|
||
qDebug() << "MainTeacher:" << grp->getMainTeacher()->toString();
|
||
qDebug() << "Duration:" << t.elapsed();
|
||
return 0;
|
||
}
|
Auch abrufbar als: Unified diff
many-to-one