Answer the question
In order to leave comments, you need to log in
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<string,string> Context {get;set;}<br/>
public string Name {get; set;}<br/>
}<br/>
public ObjectStateMap(): ClassMappublic ObjectStateMap()<br/>
{<br/>
Id(x => x.Id).GeneratedBy.Identity();<br/>
Map(x => x.Name);<br/>
HasMany(x => x.Context).Table("ContextItems").KeyColumn("TaskId")<br/>
.Cascade.All()<br/>
.AsMap("ItemKey").Element("ItemValue", c => c.Type()); <br/>
<br/>
}<br/>
}<br/>
<br/>
<br/>
Надо найти все ObjectState у которых Name = "New" и Context<string,string> содержит ключ "Id" и значение "Value". Как написать такой запрос на QueryOver или HQL?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question