DashaRV wrote:
Hi,
yes you can. Do something like this
ICriteria crit = session.CreateCriteria(typeof(TABLE1));
crit.Add(Expression.Eq("Name", name));
crit.Add(Expression.Eq("TABLE2.Bag", data2IDNumber));
where Name belongs to Table1 and Bag is the Table2 attribute.
Hi, thanks for the help. I'm not fully understanding what you're saying.
For examples sake, lets call the tables classes: Table1, Table2, and TableJN. TableJN joins Table1_ID and Table2_ID.
Mapping:
Code:
<bag name ="Items" table="TableJN" cascade ="none">
<key column="Table1_ID"/>
<many-to-many class="Item" column="Table2_ID"/>
</bag>
You're saying my ICreateria would have to be setup like this?
Code:
ICriteria crit = session.CreateCriteria(typeof(Table1)
crit.Add(Expression.Eq("Name", name));
crit.Add(Expression.Eq("Table2.Item", Table2_ID));
Then it just says it couldn't resolve the property.