How to Map Two Tables To One Class in Fluent NHibernate -


I have a problem with fluent nhiberbate mapping for two tables on a table.

I have the following database schema:

  table dbo.LocationName (LocationId INT primary key, languageand INT primary key, name VARCHAR (200)) table dbo.Language ( LanguageEnd INT Primary key, Locale CHAR (5)) and  

and want to define the following classes:

  Public class locale {public virtual int location ID {Get; Private set; } Public Virtual Ent Language (Received; Private set; } Public Virtual String {get} Set; } Public Virtual String Locale {get; Set; }}  

Here is my mapping class:

  public localized namemap () {withTable ("LocationName"); UseCompositeId (). With KayProperty (x = & gt; x.LanguageId) CapeProtti (x = & gt; x.LocationId); Map (x = & x; x.Name); Together ("Language", Lang = & gt; {Columns with lang.With ("LanguageEnd"); lang.Map (x => x.Locale);}); }  

The problem is that the local area mapping is from the second table, and especially the keys between those tables do not match whenever I run the application with this mapping, The following error is found on the following error:

Foreign key (FK7FECCSEEEEEEEEEEE: Language [Language]) should be the same as the primary key referenced in columns (local name [LanguageId, LocationId] )

May include Bhashaid area using tell the N Heibrnet to map language Sthannam?

to denormalize a class, to bring it into another column from the other table, in the FN Can not know the name.


Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -