|
From: NHibernate J. <mik...@us...> - 2007-01-09 11:25:31
|
Can't use order-by with set
---------------------------
Key: NH-854
URL: http://jira.nhibernate.org/browse/NH-854
Project: NHibernate
Type: Bug
Reporter: Kaivalya Vishnu
Priority: Blocker
I am usinh nHibernate 2.0. My code does not work if I use "order-by" attribute in .hbm.xml file with a "set"
Following is my .hbm.xml file
<class name="Contract" table="tblContracts" mutable="true">
<id name="ID" column="ID" type="Int32">
<generator class="native" />
</id>
<property name="Name" column="Name" type="String" />
<set
name="allDeals"
table="tblDeals"
inverse="true"
cascade="all-delete-orphan"
access="field"
lazy="true"
order-by="ClientName asc">
<key column="FK_ContractID" />
<one-to-many class="Deal" not-found="ignore" />
</set>
</class>
the following is my entity class definition in .NET
public class Contract
{
private int id_number;
private string name;
//private ISet<Deal>allDeals = new HashedSet<Deal>(); //Use without order-by
//private ListSet allDeals = new ListSet(); //Use without order-by
private IDictionary allDeals; //Use without order-by
public virtual int ID
{
get { return id_number; }
set { id_number = value; }
}
public virtual string Name
{
get { return name; }
set { name = value; }
}
/// <summary>
/// Do not use. Instead use:
/// deal.Liabilities.AllLiabilities
/// </summary>
/* internal virtual ISet<Deal> AllDeals
{
get { return allDeals; }
set { allDeals = value; }
}*/
internal virtual IDictionary AllDeals
{
get { return allDeals; }
set { allDeals = value; }
}
public Contract()
{
id_number = 0;
name = "Unknown";
}
public override string ToString()
{
return id_number.ToString() + "," + name;
}
}
It always throws an exception saying that can not map the entity class. Please help urgently.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.nhibernate.org/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
|