2

I have to join two tables, but there is no for those fields. Is it possible to do it?

For example

TableA (ID, MachineID, EquipmentID)

Machine (MachineID, Description)

There is a mapping for TableA.MachineID => Machine.MachineID. I can use Join for that and no issues with it.

Now I need to join TableA.EquipmentID => Machine.MachineID. Is It possible to do this without mapping fields?

Cœur
  • 37,241
  • 25
  • 195
  • 267
DineshNS
  • 3,490
  • 5
  • 26
  • 28
  • do you have `class TabkleAEntity { public Machine Machine { get; set;} public Machine Equipment { get; set;} }`? – Firo Sep 06 '11 at 08:31
  • I have class TableA{ public Machine{get;set} .... } – DineshNS Sep 12 '11 at 04:47
  • You can only do this using a subquery. It is described in [this blog post](http://nhforge.org/blogs/nhibernate/archive/2009/12/17/queryover-in-nh-3-0.aspx). – Stefan Steinegger Sep 09 '11 at 08:11
  • Hi Thanks for the reply. I saw that link before too. Every ware I saw has shown very simple samples. It is difficult to find complex one. – DineshNS Sep 12 '11 at 04:29

0 Answers0