Hello there, I'm experiment with NHibernate which so far has been a pleasant experience. However, today I hit a wall. Easiest way to explain problem is by using an example, so thats what I will do.
I have a domain object called 'Machine' which has some properties like this.
Machine Name Weight Height Length LocalizedName LocalizedDescription CultureCode
As you can see some of the properties are static like height, weight etc and will most likely never change. Then there are the properties which are language dependent like the name and description. Because of this the data model looks a little different and is split into two tables that looks like this.
Machine [PK]Name Weight Height Length
LocalizedMachine [FK]Name LocalizedName LocalizedDescription CultureCode
Even though this is a one-to-many relationship (one machine is called many different things dependent on the language) I'm only interested in working with one language at a given time. Therefore I'm not interested in a collection of LocalizedMachine objects but just the two strings in the selected language. If I want to change language I just want to change the CultureCode property. Is it possible to make such a mapping with NHibernate ?
Thanks in advance - Christian James
|