I have an entity class that looks like :
public class MyEntity
{
public virtual int Id { get; set; }
public virtual ICollection<MyOtherEntity> MyOtherEntities { get; set; }
}
I have a stored procedure in my database that returns MyEntity objects joined with MyOtherEntity objects. I'd like to map this like:
<sql-query name="MyStoredProcedure">
<return class="MyEntity">
<return-property column="MyEntityId" name="Id" />
<return-property column="MyOtherEntityId" name="MyOtherEntities.Id" />
</return>
</sql-squery>
This mapping does not work. Is there a way to map this in NHibernate?