Revision 5baea70c
Von Christian Ehringfeld vor mehr als 9 Jahren hinzugefügt
samples/example/main.cpp | ||
---|---|---|
q.setDistinct(true);
|
||
q.appendOrderBy(OrderBy(QString("birthday"), Direction::SORT_DESC));
|
||
q.setLimit(10);
|
||
QList<QSharedPointer<Pupil>> list = e->find<Pupil>(q, true);
|
||
QList<QSharedPointer<Pupil>> list = e->find<Pupil>(q, true,false);
|
||
for (int i = 0; i < list.size(); ++i) {
|
||
qWarning() << list.at(i)->toString();
|
||
}
|
src/entitymanager.h | ||
---|---|---|
* @param toInitialize list of entity classnames which database tables should be created
|
||
* @return
|
||
*/
|
||
bool startup(QString version, QStringList toInitialize, bool createIndices = false);
|
||
bool startup(QString version, QStringList toInitialize,
|
||
bool createIndices = false);
|
||
bool executeQuery(const QString &query);
|
||
static void removeConnectionName(const QString &name);
|
||
QSharedPointer<Entity> findById(const qint64 &id, const QString &classname);
|
||
... | ... | |
EntityManager(const QString &databaseType, QString databasename = "" ,
|
||
QString hostname = "",
|
||
QString username = "",
|
||
QString password = "", QString port = "", bool logQueries = false, QString databaseOptions = "");
|
||
QString password = "", QString port = "", bool logQueries = false,
|
||
QString databaseOptions = "");
|
||
~EntityManager();
|
||
static QStringList getConnectionNames();
|
||
QSharedPointer<QueryBuilder> getQueryBuilder() const;
|
||
... | ... | |
QSqlQuery query = this->queryInterpreter->build(q);
|
||
auto maps = this->convertQueryResult(query);
|
||
auto converted = this->convert(maps, EntityHelper::getClassname(ptr.data()),
|
||
false,
|
||
resolveRelations);
|
||
return this->convertList<T>(converted);
|
||
}
|
Auch abrufbar als: Unified diff
fix