c# - null values in NHibernate returning list -


i'm trying understand following behaviour of nhibernate , can't.

session.createcriteria<param>()   .add(restrictions.eq("groupid", groupid))   .add(restrictions.eq("paramid", paramid))   .list<param>() 

this construction should return collection 1 database row(object). returns list single null element. suggest why?

p.s. param class mapping has composite key.

public class param {     public param()     {     }     public param(string groupid, string paramid, string paramname) : this()     {         groupid = groupid;         paramid = paramid;         paramname = paramname;     }     public virtual string groupid { get; protected set; }     public virtual string paramid { get; protected set; }     public virtual string paramname { get; protected set; }     public virtual string value { get; set; }      public override bool equals(object obj){...}     public override int gethashcode(){...} }  public class parammap : classmap<param> {     public parammap()     {         table("params");          compositeid()             .keyproperty(x => x.groupid)             .keyproperty(x => x.paramid)             .keyproperty(x => x.paramname, "paramname");          map(x => x.value, "paramvalue");     } } 

this query copied database log. nhibernate executes it.

select this_.groupid groupid19_0_, this_.paramid paramid19_0_, this_.paramname paramname19_0_, this_.paramvalue paramvalue19_0_ params this_ this_.groupid = :1 , this_.paramid = :2  \ workhour,totalhours,  / 

returns 1 row:

groupid = "workhour" paramid = "totalhours" paramname = (empty)  paramvalue = yes 

that fault. paramname value not empty string. it's null! so, strange behaviour of nhibernate reason found.


Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -