Hi guys I'm a new to NHibernate. I just started development of my next project using NHibernate. One of the requirements is that entity classes should be localized. I'm doing localization the following way: - Every entity which should be localized is split into 2 table and 2 entities. For example, I have an entity Service which holds some information, and another entity ServiceLocale which holds localized properties, such as Name, description etc. Same goes for tables.
Service has a protected field which holds a list of ServiceLocales. ServiceLocale has a property Culture which specifies which language the object belongs.
The list of ServiceLocale is loaded eagerly from xml mapping file. So when Service is loaded from database, all ServiceLocales also is loaded for this service object.
Service has public properties, Name and Description. From this properties, I check what's current culture, load appropriate ServiceLocale object and return ServiceLocale's Name and Description.
Service is persisted using a repository. The repository checks saves or updates the service, and also all of it's ServiceLocale objects.
So my question is: is there a better way to achieve this kind of transparent localization via NHibernate? Thanks