Hey James Gregory, 

I just stumbled upon this! You sere are a life saver! Thank you.

Kind Regards,

Anis Ahmed Chohan.

On Thursday, 7 May 2009 16:04:35 UTC+1, James Gregory wrote:
>
> You'd map your Recipe entity as normal, and associate it with the first 
> table. Inside that mapping you'd then use the WithTable method to extend 
> the mapping over the second table.
>
> Something like this:
>
> public class RecipeMap : ClassMap<Recipe>
> {
>   public class RecipeMap()
>   {
>     // Recipe table mappings
>     Id(x => x.ID);
>
>     // RecipeLang mappings
>     WithTable("RecipeLang", m =>
>     {
>       m.Map(x => x.Title);
>     });
> }
>
> On Thu, May 7, 2009 at 3:57 PM, HighTower <high...@gmail.com <javascript:>
> > wrote:
>
>>
>> Hi
>>
>> I'm quite new to NHibernate and Fluent Nhibernate.
>> I'm in the process of starting a new project where we have lanugage
>> support in the database, so that we can translate one article to
>> different languages.
>>
>> The structure of the database tables is as follows:
>>
>> dbo.Recipe
>> -ID (PK)
>> -Portions
>> -CreatedBy
>> -etc
>>
>> dbo.RecipeLang
>> -ID (PK)
>> -LanguageID (PK)
>> -Title
>> -Description
>> -etc
>>
>> My entity/domain class looks like this:
>> Recipe
>> -ID
>> -Title
>> -Description
>> -Portions
>> -CreatedBy
>> -etc
>>
>> What I'd like to do is to merge the Recipe and RecipeLang tables i to
>> the Recipe class. As you can see, it contains properties/fields from
>> both db tables. Is this possible, and if so, how can I do it?
>>
>> Thanks
>>
>>
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Fluent NHibernate" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to fluent-nhibernate+unsubscr...@googlegroups.com.
To post to this group, send email to fluent-nhibernate@googlegroups.com.
Visit this group at http://groups.google.com/group/fluent-nhibernate.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to