I'm trying to map a simple data structure in nhibernate and do an query on
it. Any help would be appreciated.
The multi-part identifier "ms1_1_.Naam" could not be bound.
_session.Query<I>().Where(x => x.Ms.Any(c => c.Naam.Contains("Bart"))) select t
sql:
select i0_.B_id as Id11_,
i0_.Lid as Lid12_
from I i0_
inner join [B] i0_1_
on i0_.B_id = i0_1_.Id
where exists (select ms1_.U_id
from M ms1_
where i0_.B_id = ms1_.U_id
and (ms1_1_.Naam like ('%' + 'Bart' /* @p0 */ + '%')))
mapping:
public class BMap : IAutoMappingOverride<B>
{
public void Override(AutoMapping<B> mapping)
{
mapping.HasMany(x => x.Ms).Inverse().Cascade.SaveUpdate();
}
}
model:
public class B : Entity
{
public B()
{
Ms = new List<M>();
}
public virtual IList<M> Ms { get; set; }
}
public class I : B
{
public virtual bool Lid { get; set; }
}
public class U : Entity
{
public virtual string Naam { get; set; }
}
public class M : U
{
public virtual bool Login { get; set; }
public virtual B B { get; set; }
}
--
You received this message because you are subscribed to the Google Groups
"nhusers" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/nhusers/-/1EkDuH63vjEJ.
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.