Herunterladen als
root/src/attributeresolver.h @ 7b467bf5
d27d606d | 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:
|
|||
AttributeResolver(QSharedPointer<QueryBuilder> queryBuilder);
|
|||
virtual ~AttributeResolver();
|
|||
bool containsAttribute(const QString &className, const QString &attribute) const;
|
|||
Attribute* resolveAttribute(const QSharedPointer<Entity> &classObj,
|
|||
const QString &attribute, QSharedPointer<Entity> related = QSharedPointer<Entity>());
|
|||
95a2ba7e | Christian Ehringfeld | Attribute* resolveAttribute(const QString &className, const QString &attribute, const QString related="");
|
|
d27d606d | Christian Ehringfeld | QHash<QString, QHash<QString, Attribute *>> getAttributes() const;
|
|
void setAttributes(const QHash<QString, QHash<QString, Attribute *>> &value);
|
|||
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);
|
|||
19082efe | Christian Ehringfeld | const QMetaObject *resolveInheritance(const QSharedPointer<Entity> &e,
|
|
Attribute *&attribute);
|
|||
d27d606d | Christian Ehringfeld | 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
|