I'm using Iesi.Collections.ISet to map the <set> </set>
and still have related error:
System.InvalidCastException: Specified cast is not valid.
Code:
public class DUser
{
private int uId;
private string uName;
private string uPassword;
private string uEmail;
private ISet dirs = new HashedSet();
..........................
..........................
public ISet Dirs
{
set {dirs = value;}
get {return dirs; }
}
}
getting data:
Code:
{
IList list = null;
............
............
String HQL_Query = "from DUser user where user.UName='balblabla' ";
list = session.CreateQuery(HQL_Query).List();
}
Code:
<class name="Test1.DUser,Test1" table="Users">
<id name="UId" column="Id" type="int">
<generator class="increment"/>
</id>
<property name="UName" column="Name" type="String" length="40"/>
<property name="UPassword" column="Pass" type="String" length="20"/>
<property name="UEmail" column="Email" type="String" length="40"/>
<set name="Dirs">
<key column="uID"/>
<one-to-many class="Test1.UDirectory,Test1"/>
</set>
</class>