Revision 992116ed
Von Christian Ehringfeld vor mehr als 9 Jahren hinzugefügt
example/Example.pro | ||
---|---|---|
unix:!macx: LIBS += -L$$PWD/../../build-EntityManager-Desktop-Debug -lCuteEntityManager
|
||
unix:INCLUDEPATH += $$PWD/../src
|
||
unix:DEPENDPATH += $$PWD/../src
|
||
CONFIG += c++11
|
||
CONFIG += c++14
|
||
|
||
win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../build-EntityManager-Desktop_Qt_5_4_1_MinGW_32bit-Debug/release/ -lCuteEntityManager
|
||
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../build-EntityManager-Desktop_Qt_5_4_1_MinGW_32bit-Debug/debug/ -lCuteEntityManager
|
src/entityinstancefactory.cpp | ||
---|---|---|
if (!s.contains("*")) {
|
||
s.append("*");
|
||
}
|
||
return EntityInstanceFactory::createInstance(QMetaType::type(
|
||
s.toUtf8().constData()));
|
||
int type = QMetaType::type(
|
||
s.toUtf8().constData());
|
||
return EntityInstanceFactory::createInstance(type);
|
||
}
|
||
|
||
Entity *EntityInstanceFactory::createInstance(const QString &className) {
|
src/querybuilder.cpp | ||
---|---|---|
auto usedProperties = QHash<QString, QMetaProperty>();
|
||
auto usedRelations = QHash<QString, Relation>();
|
||
QSharedPointer<Entity> e;
|
||
for (int var = classes.size(); var >= 0; --var) {
|
||
for (int var = classes.size()-1; var >= 0; --var) {
|
||
auto metaObj = classes.at(var);
|
||
e = QSharedPointer<Entity>(EntityInstanceFactory::createInstance(
|
||
metaObj->className()));
|
src/querybuilder.h | ||
---|---|---|
const QString &primaryKey = "id") const;
|
||
QSqlQuery update(const QString &tableName, QHash<QString, QVariant> &attributes,
|
||
const QString &primaryKey = "id") const;
|
||
QList<QSqlQuery> createOrMerge(const QSharedPointer<Entity> &entity, bool insert) const;
|
||
QList<QSqlQuery> createOrMerge(const QSharedPointer<Entity> &entity,
|
||
bool insert) const;
|
||
virtual void createRelationFK(QStringList &queries,
|
||
const QSharedPointer<Entity> &entity, const Relation &relation,
|
||
const QMetaProperty &metaProperty, const QString &update,
|
Auch abrufbar als: Unified diff
small bugfxi