I have a couple of entities that I want to treat as an aggregate. The problem is their association is conceptual rather than via foreign keys in the DB.
The schema I was given:
(source: robtennyson.us )
My goal is to create an InventoryWeek
class that I add inventory transactions to. So the inventory week obviously wraps FACIL_INVENTORY_WEEK
and the transactions are added to FACIL_INVENTORY
. So pulling this from the DB, I would get the week given the facility and date, and then I would want all of the transactions that have an INVENTORY_DATE
within the week.
Is there a way to map this relationship in nhibernate? Or is there a better way to model this altogether?
You can map relations between tables based on non-primary-keys, but in a limited way.
To give some specific advise, you have to ask a more specific question. Try to map it and if something does not work as you expect, ask.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.