|
Lightweight 0.20260625.0
|
Represents a one-to-one relationship through a join table. More...
#include <HasOneThrough.hpp>
Public Types | |
| using | ThroughRecord = ThroughTable |
| The record type of the "through" side of the relationship. | |
| using | ReferencedRecord = OtherTable |
| The record type of the "Other" side of the relationship. | |
Public Member Functions | |
| LIGHTWEIGHT_FORCE_INLINE constexpr void | EmplaceRecord (std::shared_ptr< ReferencedRecord > record) |
| Emplaces the given record into this relationship. | |
| LIGHTWEIGHT_FORCE_INLINE constexpr ReferencedRecord & | Record () noexcept |
| Retrieves the record in this relationship. | |
| LIGHTWEIGHT_FORCE_INLINE constexpr ReferencedRecord const & | Record () const noexcept |
| Retrieves the record in this relationship. | |
| LIGHTWEIGHT_FORCE_INLINE constexpr bool | IsLoaded () const noexcept |
| Checks if the record is loaded. | |
| LIGHTWEIGHT_FORCE_INLINE void | Unload () noexcept |
| Unloads the record from memory. | |
| LIGHTWEIGHT_FORCE_INLINE constexpr ReferencedRecord & | operator* () noexcept |
| Retrieves the record in this relationship. | |
| LIGHTWEIGHT_FORCE_INLINE constexpr ReferencedRecord const & | operator* () const noexcept |
| Retrieves the record in this relationship. | |
| LIGHTWEIGHT_FORCE_INLINE constexpr ReferencedRecord * | operator-> () noexcept |
| Retrieves the record in this relationship. | |
| LIGHTWEIGHT_FORCE_INLINE constexpr ReferencedRecord const * | operator-> () const noexcept |
| Retrieves the record in this relationship. | |
| std::weak_ordering | operator<=> (HasOneThrough const &other) const noexcept=default |
| Default three-way comparison operator. | |
| void | SetAutoLoader (Loader loader) |
| Used internally to configure on-demand loading of the record. | |
Static Public Attributes | |
| static constexpr auto | OwnerSelector = TheOwnerSelector |
| Singles out the join record's foreign key pointing at the record owning this relationship. | |
| static constexpr auto | ThroughSelector = TheThroughSelector |
| Singles out ReferencedRecord's foreign key pointing at ThroughRecord. | |
Represents a one-to-one relationship through a join table.
The OtherTable parameter is the record reached through the join table. The ThroughTable parameter is the join table, which references the current record.
Both foreign keys are located by matching the relationship type. When either record holds more than one foreign key into the same table, name the column to single one out - see the RelationSelector concept and the example on HasManyThrough.
| OtherTable | The record type reached through the join table. |
| ThroughTable | The join record type, holding a foreign key back to the owning record. |
| TheOwnerSelector | Singles out the join record's foreign key pointing at the owning record. |
| TheThroughSelector | Singles out OtherTable's foreign key pointing at ThroughTable. |
Definition at line 37 of file HasOneThrough.hpp.
| using Lightweight::HasOneThrough< OtherTable, ThroughTable, TheOwnerSelector, TheThroughSelector >::ThroughRecord = ThroughTable |
The record type of the "through" side of the relationship.
Definition at line 45 of file HasOneThrough.hpp.
| using Lightweight::HasOneThrough< OtherTable, ThroughTable, TheOwnerSelector, TheThroughSelector >::ReferencedRecord = OtherTable |
The record type of the "Other" side of the relationship.
Definition at line 48 of file HasOneThrough.hpp.
|
inlineconstexpr |
Emplaces the given record into this relationship.
Definition at line 59 of file HasOneThrough.hpp.
|
inlineconstexprnoexcept |
Retrieves the record in this relationship.
Definition at line 62 of file HasOneThrough.hpp.
|
inlineconstexprnoexcept |
Retrieves the record in this relationship.
Definition at line 65 of file HasOneThrough.hpp.
|
inlineconstexprnoexcept |
Checks if the record is loaded.
Definition at line 68 of file HasOneThrough.hpp.
|
inlinenoexcept |
Unloads the record from memory.
Definition at line 71 of file HasOneThrough.hpp.
|
inlineconstexprnoexcept |
Retrieves the record in this relationship.
Definition at line 75 of file HasOneThrough.hpp.
|
inlineconstexprnoexcept |
Retrieves the record in this relationship.
Definition at line 79 of file HasOneThrough.hpp.
|
inlineconstexprnoexcept |
Retrieves the record in this relationship.
Definition at line 83 of file HasOneThrough.hpp.
|
inlineconstexprnoexcept |
Retrieves the record in this relationship.
Definition at line 87 of file HasOneThrough.hpp.
|
inline |
Used internally to configure on-demand loading of the record.
Definition at line 99 of file HasOneThrough.hpp.
Referenced by Lightweight::DataMapper::ConfigureRelationAutoLoading().
|
staticconstexpr |
Singles out the join record's foreign key pointing at the record owning this relationship.
Definition at line 51 of file HasOneThrough.hpp.
|
staticconstexpr |
Singles out ReferencedRecord's foreign key pointing at ThroughRecord.
Definition at line 54 of file HasOneThrough.hpp.