Hi there,
I have an issue when I have an object linked twice to another object, let me explain.
I have tables
Server 1-* ServerGroup_Server *-1 Server Group
Server 1-* Server Group
Mapping File
Code:
<class name="Support.v1.Domain.ServerGroup, Support.v1.Domain" table="ServerGroup">
<id name="Identity" column="servergroup_id">
<generator class="guid.comb" />
</id>
<property name="Name" column="name"/>
<many-to-one name="Owner" class="Support.v1.Domain.Employee, Support.v1.Domain" column="owner_id"/>
<many-to-one name="GroupMonitor" class="Support.v1.Domain.Server, Support.v1.Domain" column="group_monitor"/>
<bag name="Servers" table="ServerGroup_Server" lazy="true" cascade="save-update">
<key column="servergroup_id" />
<many-to-many class="Support.v1.Domain.Server, Support.v1.Domain" column="server_id"/>
</bag>
</class>
The Server Group has a collection of servers, one of which is also the GroupMonitor.
I want it to return the full collection of servers but also a populated server object for the GroupMonitor property
Currently It only returns the collection of servers minus the GroupMonitor server.
Any ideas or help welcome!
Thanks