Nhibernate HQL Anonymous Class (strictly speaking the use of maps and the use of constructors

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.