fk() SQM function

Description

Sometimes it is useful to unequivocally refer to the key-side of a foreign-key. This mostly comes up with @NotFound mappings, where we generally join and use the target-side of the foreign-key.

Given a not-found mapping Coin#currency (from the testsuite), a query like from Coin c where c.currency.id = 1 will result in a SQL query with a join and the predicate based on the Currency’s id column.

But it is sometimes useful to be able to refer explicitly to the foreign-key key-side. To allow for this, add a fk(...) “function” to SQM

E.g. from Coin c where fk(c.currency) = 1

Activity

Show:
Fixed

Details

Assignee

Reporter

Priority

Created March 3, 2022 at 8:59 PM
Updated August 26, 2023 at 3:58 PM
Resolved April 8, 2022 at 7:49 AM