Reference Data and Lookups
Many domains contain reference data – data that is generally static, and that users are not expected to modify. Typical examples include lists of countries or currencies. Reference data is also known as lookup data, referring to the fact that you use look things up in the reference data, but you don’t change it.
A transactional entity – that is, one which is taking part in a unit of work – may refer to reference data, and it’s convenient to materialise this reference data as an entity for lookup purposes. For example, a Customer might have a reference to a Country so that you can display the country name. But for large data sets it’s not desirable for a reference entity to have a collection of all the entities associated with it. For example, if you have tens of millions of customers, you probably don’t want each Country entity to have a collection of the customers in that country.
For this scenario, LightSpeed supports one‑way associations. To make an association one‑way, select the association arrow and delete the collection name. You should also cache the reference data entity using the Cached and Cache Expiry settings.
(To make a one‑way association between hand‑coded entities, omit the EntityCollection<T> field on the reference entity class, and apply NoReverseAssociationAttribute to the EntityHolder<T> field in the transactional entity class.)
One‑way associations should be used only with reference data. There is an efficiency impact if you use a one‑way association and the referenced entity is not cached. Therefore, one‑way associations are useful only when the associated entities can be loaded once and rarely change.