Hi,
please can someone post an example on how to use the where clause on mapping a class collection?
I have these two classes:
Code:
User {
...
private IList messages = new ArrayList();
public IList Messages {
get { return messages; }
set { messages = value;
}
...
}
Message {
...
private bool deleted = false;
public bool Deleted {
get { return deleted; }
set { deleted = value; }
}
...
}
Code:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.0">
<class name="yyy.User, yyy" table="Users">
...
<bag name="Messages" where="deleted = 0" inverse="true" lazy="true" order-by="IDMessage" cascade="all">
<key column="IDUser"/>
<one-to-many class="yyy.Message, yyy"/>
</bag>
</class>
</hibernate-mapping>
But this doesn't work... can you help me?
Tnx