[ROOT] / doc / toc / ARCCore / Class / PKRelAttribute

EnforceReferentialIntegrity , ForeignEntity , Initialize , IsDefault , OppositeTerm , TryRemoveP


Describes relationships between entities (between tables in RDBMS terms).

Note than in general relationsships are picked up automatically in AgoRapide through standardized naming of keys.

For instance, for 'Order', key 'CustomerId' is automatically assumed to point to a ForeignEntity of type 'Customer', so this attribute does not have to be specified.

However, for 'Employee', key 'SupervisorId' where the supervisor is another 'Employee', ForeignEntity has to be explicitly specified in order for the system to understand that 'SupervisorId' is actually a foreign key pointing to another 'Employee'.
(this is not necessarily limited to self-referencing tables, another example could be 'Transaction' with 'FromAccountId' and 'ToAccountId' both pointing to an 'Account'.)

Used by ARCQuery (in QueryExpressionRel and ForeignKey) in order to enable queries like:
"Employee/WHERE DepartmentId = 'Sales'/REL Supervisor" (all Supervisors of Employees in Sales) and
"Employee/WHERE DepartmentId = 'Sales'/SELECT Name, Supervisor.Name).

In addition to explicit stating ForeignEntity, this attribute is also used to EnforceReferentialIntegrity
.
See also IPRelationsKeysPointingTo and IPRelationsKeysPointingFrom in ARCQuery.


EnforceReferentialIntegritySee EnforceReferentialIntegrity.
ForeignEntitySee ForeignEntity.
InitializeTo be overridden in sub-classes, but do note that sub-classes are supposed to call base.Initialize() at end of their own initialization.
IsDefaultDoes not have a corresponding BaseAttributeP since all attributes relevant for querying (for instance in the documentation) will be IsDefault = FALSE anyway. (if we had included it in BaseAttributeP it would just have led to a lot of confusing IsDefault = FALSE key-values showing up.)
OppositeTermSee OppositeTerm.
TryRemovePShould probably never be used.

Details

Generated 2024-04-19 02:19:03.534 UTC