The 1.map uses Var hql=string. Format (@ "Select New Map (TC. Limitindextype as LIMITINDEXTYPE,TC. Limitscope as LIMITSCOPE,TB. ID as ID) from Baslimitconfig tb,basproductgroup ta, Baslimittype TC where TB. Limitdim1id =ta. Id and TB. LIMITDIM2ID = TC. Id ");//This is the package of my framework is actually the session. Createqueryvar List2 = dao.findlist<object> (info); foreach (System.Collections.Hashtable entityobj in List2) {var Ofield = Entityobj.getenumerator (); while (Ofield.movenext ()) {string keyName = OField.Key.ToString (); Object keyValue = Ofield.value;}} 2. The constructor uses Var hql= string. Format (@ "Select New Baslimitconfig (TC. LIMITINDEXTYPE,TC. LIMITSCOPE,TB) from Baslimitconfig tb,basproductgroup ta, Baslimittype TC where TB. Limitdim1id =ta. Id and TB. LIMITDIM2ID = TC. Id "), the entity's constructor is as follows (non-default) public baslimitconfig (int limitindextype,int limitscore,baslimitconfig b) {Limitindextype = Limitindextype; Limitscope = Limitscore; Limitconditionid = B.limitconditionid; Limittypeid = B.limittypeid; Limittypename = B.limittypename; Limitdim1id = B.limitdim1id; LimitdIm1value = B.limitdim1value; Limitdim2id = B.limitdim2id; Limitdim2value = B.limitdim2value; Lowerlimitvalue = B.lowerlimitvalue; Yellowlimitvalue = B.yellowlimitvalue; Redlimitvalue = B.redlimitvalue; Upperlimitvalue = B.upperlimitvalue; TotalAmount = B.totalamount; Actualisamount = B.actualisamount; Partisamount = B.partisamount; Limitbundlename = B.limitbundlename; Type = B.type; Protype = B.protype; Busitype = B.busitype; Limittype = B.limittype; Limitobjecttype = B.limitobjecttype; Limit1fulllevel = B.limit1fulllevel; Limit2fulllevel = B.limit2fulllevel; Quotausage = B.quotausage;} The framework encapsulates the internal invocation session. Createqueryvar quotalist = holworth.utility.hrautility.listtot<baslimitconfig> (Dao.FindList (treeInfo));
Nhibernate HQL Anonymous Class (strictly speaking the use of maps and the use of constructors