Fist, stop thinking in tables. Think in your object model.
Table1 probably persists instances of Class1, Table2 does the same for
Class2.
Table2 has a FK to Table1, then Class2 has a property of type Class1, mapped
as a many-to-one relation.
Everything you are asking is answered in the official documentation (
http://nhforge.org/doc/nh/en/index.html). Start by reading it and feel free
to ask us when you don't understand how to do something.

   Diego


On Mon, Mar 29, 2010 at 10:43, Kiran Kumar <[email protected]> wrote:

> Hi,
>       The scenario is suppose there are 2 tables
>
> 1)    Table1 and table2
>
>     table1 has primary key, table2 has foreign key,
>
>     there is also another column say some x which are common in both the
> tables and i want to join the tables based on column x
>
>    how should i do it.
>
> 2) If i want to add conditions say and or on the query, how should i do it.
>
> Thanks,
> Kiran
>
>
>
>
>
>
>
> On Sun, Mar 28, 2010 at 10:17 PM, Diego Mijelshon 
> <[email protected]>wrote:
>
>> What are your classes? NHibernate maps a domain model to a database; it's
>> not a database query tool.
>>
>>    Diego
>>
>>
>>   On Sun, Mar 28, 2010 at 22:37, Kiran Kumar <[email protected]>wrote:
>>
>>>  i have question, suppose there is a scenario to join 2 tables in
>>> nhibernate  and which are non primary keys and foreign key how should
>>> i do it.
>>>
>>>       Kindly reply asap.
>>>
>>> Thanks,
>>> Kiran
>>>
>>> --
>>>
>>> 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]<nhusers%[email protected]>
>>> .
>>> For more options, visit this group at
>>> http://groups.google.com/group/nhusers?hl=en.
>>>
>>>
>> --
>> 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]<nhusers%[email protected]>
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/nhusers?hl=en.
>>
>
>  --
> 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]<nhusers%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/nhusers?hl=en.
>

-- 
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.

Reply via email to