Hi,
I have an entity, which has a list of "lines" which are mapped as components:
Code:
<class name="User" table="Employee" mutable="false">
<id name="Id">
<generator class="native"/>
</id>
<property name="Account"/>
<set name="Lines" table="UserLine">
<key column="UserId"/>
<element column="LineName" type="string"/>
</set>
</class>
so how can I select all linenames for a certain account using the criteria api? I tried
Code:
DetachedCriteria userLines = DetachedCriteria.For(typeof(User))
.SetProjection(Projections.Property("Lines"))
.Add(Expression.Eq("Account", userId));
but the resulting SQL looks like this:
Code:
SELECT this_0_.Id as y0_ FROM Employee this_0_ WHERE this_0_.Account = :p0); :p0 = 'domain\a'
[/code]