V
V
vadim9112011-11-01 09:13:57
NHibernate
vadim911, 2011-11-01 09:13:57

Write a query using Nhibernate?

Good afternoon, help me write a query using NHibernate.
There is a class

public ObjectkState<br/>
{<br/>
 public long Id {get;set;}<br/>
 public IDictionary&lt;string,string&gt; Context {get;set;}<br/>
 public string Name {get; set;}<br/>
}<br/>

There is a mapping:
public ObjectStateMap(): ClassMappublic ObjectStateMap()<br/>
 {<br/>
 Id(x =&gt; x.Id).GeneratedBy.Identity();<br/>
 Map(x =&gt; x.Name);<br/>
 HasMany(x =&gt; x.Context).Table(&quot;ContextItems&quot;).KeyColumn(&quot;TaskId&quot;)<br/>
 .Cascade.All()<br/>
 .AsMap(&quot;ItemKey&quot;).Element(&quot;ItemValue&quot;, c =&gt; c.Type()); <br/>
<br/>
}<br/>
}<br/>
<br/>
<br/>
Надо найти все ObjectState у которых Name = &quot;New&quot; и Context&lt;string,string&gt; содержит ключ &quot;Id&quot; и значение &quot;Value&quot;. Как написать такой запрос на QueryOver или HQL?

Answer the question

In order to leave comments, you need to log in

Similar questions

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question