Hi NHGroup, Using DetachedCriteria solved my purpose.
Thanks & Regards, Vinay Sulanki On Thursday, February 21, 2013 2:12:44 PM UTC+5:30, [email protected] wrote: > > Hi NHGroup, > > My scenario is like I have a parent child relationship where a parent can > have multiple childs and in parent mapping I have bag for child. > > I want to construct a query which would at a time match 3 columns of > parent and 2 columns of child, and I get the inputs in sets such as if i > get 10 inputs then each contain 3 input parameter for Parent and 2 for > child. > > If a perform a create alias then join happens and suppose if for a parent > it has 6 childrens then if all the criteria match then I end up with 6 > records but when applying distinct or .SetResultTransformer(new > DistinctRootEntityResultTransformer()) > > I end up with a single parent record. My objective is to fetch counts of > parent not of childrens. How may I put it. > > Means SetMaxResults(count).distinct() must fetch me for parent while it > happens that if I remove distinct() then it fetches the childs and when > distinct is applied I end up with a single parent. > > How can I query such that I can match parent as well as child at a time > with .SetmaxResults() to fetch max results of parents? Please give me some > suggestions about it. > > Thanks & Regards, > Vinay Sulanki > -- You received this message because you are subscribed to the Google Groups "nhusers" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/nhusers?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
