R.Binu Port Blair wrote:In the above example if I query for a Contact Detail of a Node all Houses are selected.
Based on the above example, if you give a NodeID, you can get all the houses realted to that particular one. Doesn't look like an issue here.
Though, if you want that only Parent Hourse details are fetched for a nodeID, (though system allows multiple houses for a Node 1 being parent and others if any being as secondary), in that case:
1. Have a new field in Node table as 'ParentHouseID(FK)' which can be nullable. Fill this only with parent HouseID when you map it in UI.
2. Have a new bit field in House Table as 'IsParentHouseID' which will be marked true if it is mapped as a parent houseID for a particular node. For rest of the houseid's mapped to that node will fill this as false.
Now while quering, use the added new field to get the data.