Skip to content

Commit

Permalink
added RelatedType to all relation classes
Browse files Browse the repository at this point in the history
  • Loading branch information
silverqx committed May 28, 2022
1 parent f759ba3 commit 9b2610b
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 0 deletions.
3 changes: 3 additions & 0 deletions include/orm/tiny/relations/belongsto.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ namespace Orm::Tiny::Relations
const QString &relationName);

public:
/*! Related instance type passed to the relation. */
using RelatedType = Related;

/*! Virtual destructor. */
inline ~BelongsTo() override = default;

Expand Down
3 changes: 3 additions & 0 deletions include/orm/tiny/relations/belongstomany.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ namespace Orm::Tiny::Relations
const QString &relatedKey = "", const QString &relationName = "");

public:
/*! Related instance type passed to the relation. */
using RelatedType = Related;

/*! Virtual destructor. */
inline ~BelongsToMany() override = default;

Expand Down
3 changes: 3 additions & 0 deletions include/orm/tiny/relations/hasmany.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ namespace Orm::Tiny::Relations
const QString &foreignKey, const QString &localKey);

public:
/*! Related instance type passed to the relation. */
using RelatedType = Related;

/*! Virtual destructor. */
inline ~HasMany() override = default;

Expand Down
3 changes: 3 additions & 0 deletions include/orm/tiny/relations/hasone.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ namespace Orm::Tiny::Relations
const QString &foreignKey, const QString &localKey);

public:
/*! Related instance type passed to the relation. */
using RelatedType = Related;

/*! Virtual destructor. */
inline ~HasOne() override = default;

Expand Down
3 changes: 3 additions & 0 deletions include/orm/tiny/relations/hasoneormany.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ namespace Orm::Tiny::Relations
const QString &foreignKey, const QString &localKey);

public:
/*! Related instance type passed to the relation. */
using RelatedType = Related;

/*! Pure virtual destructor. */
inline ~HasOneOrMany() override = 0;

Expand Down

0 comments on commit 9b2610b

Please sign in to comment.