Herunterladen als
root/src/attributeresolver.h @ 49762cb7
dbd41a3a | Christian Ehringfeld | #ifndef ATTRIBUTERESOLVER_H
|
|
#define ATTRIBUTERESOLVER_H
|
|||
#include <QHash>
|
|||
#include <QString>
|
|||
#include "attribute.h"
|
|||
#include "entity.h"
|
|||
namespace CuteEntityManager {
|
|||
class QueryBuilder;
|
|||
class AttributeResolver {
|
|||
public:
|
|||
5ca225ed | Christian Ehringfeld | explicit AttributeResolver(QSharedPointer<QueryBuilder> queryBuilder);
|
|
dbd41a3a | Christian Ehringfeld | virtual ~AttributeResolver();
|
|
bool containsAttribute(const QString &className, const QString &attribute) const;
|
|||
Attribute* resolveAttribute(const QString &className, const QString &attribute,
|
|||
const QString related = "");
|
|||
QHash<QString, QHash<QString, Attribute *>> getAttributes() const;
|
|||
void setAttributes(const QHash<QString, QHash<QString, Attribute *>> &value);
|
|||
QSharedPointer<QueryBuilder> getQb() const;
|
|||
protected:
|
|||
Attribute* resolveManyToManyAttribute(const QSharedPointer<Entity> &e,
|
|||
const QString &attr, const Relation &r, const QSharedPointer<Entity> &target);
|
|||
Attribute* resolveManyToOneAttribute(const QSharedPointer<Entity> &e, const QString &attr,
|
|||
const Relation &r, const QSharedPointer<Entity> &target);
|
|||
Attribute* resolveOneToManyAttribute(const QSharedPointer<Entity> &e, const QString &attr,
|
|||
const Relation &r, const QSharedPointer<Entity> &target);
|
|||
Attribute* resolveNonRelatedAttribute(const QSharedPointer<Entity> &e,
|
|||
const QString &attr);
|
|||
const QMetaObject *resolveInheritance(const QSharedPointer<Entity> &e,
|
|||
Attribute *&attribute);
|
|||
void addAttribute(const QString &className, Attribute *&attr);
|
|||
Attribute* resolveExplicitAttribute(const QSharedPointer<Entity> &classObj,
|
|||
const QString &attribute, QSharedPointer<Entity> related = QSharedPointer<Entity>());
|
|||
private:
|
|||
QSharedPointer<QueryBuilder> qb;
|
|||
QHash<QString, QHash<QString, Attribute*>> attributes;
|
|||
};
|
|||
}
|
|||
#endif // ATTRIBUTERESOLVER_H
|