Hi, I am a relatively new NH user and am having trouble dealing with one area of our domain.
In our domain we have an account entity that maps directly to one table. In addition, we have an account_values_history table which stores a subset of data (which changes daily) that is also stored in the main account table. In other words, we have a daily batch that runs and does some processing. It enters a new row in the account_values_history table, and updates the value fields for the account in the main account table with the current values. With that (foggy) background, here is the dilemma: Loading an account entity with the current values is easy - it's just a matter of session.get<Account>(1). However, at times we need to load an account for a given date, and in that case we need some of the account properties set from the main account table, but we also need other properties set from the account_values_history table. The first thing that comes to mind is some sort of conditional join in which if you are loading an account for a given date you need to pull some data from the main account table, but then also join on the account_values_history table on the account id and a date, to get the current values. Confusing enough? I am having a hard time reconciling how to deal with this in NH in a clean manner. I want the domain api to be simple, if possible. What makes this worse is the account entity is a root with child collections, but I will leave that for later ;). Any suggestions? -- You received this message because you are subscribed to the Google Groups "nhusers" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/nhusers?hl=en.
