Consider the Employees table from SQL server's Northwind sample database. This table has a self JOIN on the ReportsTo field.
If I generate a standard adapter DAL for this database, the table would have TWO relations
EmployeesEntityUsingEmployeeIDReportsTo
and
EmployeesEntityUsingReportsTo
In DbCount computations where I want number of employees that report to a known employeeId, I should use the (EmployeesEntityUsingEmployeeIDReportsTo
) relation and the (ReportsTo) field in the filterBucket I would build for this cmputation.
If I want to write a TDL template, I know that I have to use
<[Foreach RelatedEntity OneToMany]><[If Not MappedFieldRelationIsHidden]>
but then how can I know that the relation is a self join relation inside this loop?