NHibernate: Query filtering on a list of values using criteria -


I'm trying to filter by using a list of prices using the Criteria API. I suspect that this is not possible, I'm just asking for sure here.

  class Entity {int id {get; Set; } IiLIT & lt; Guid & gt; Guides {Get; Set; }}  

Mapping:

  & lt; Class name = "entity" & gt; & Lt; Id ... & gt; & Lt; / Id & gt; & Lt; Bag name = "Goods" table = "Entity_grids" & gt; & Lt; Major column = "entity_fk" /> & Lt; Element column = "good" /> & Lt; / Bag & gt; & Lt; / Square & gt;  

It is believed that I have a list of guides (in fact this is another subquery) I want to filter all the units where at least one grid is in the list of grids .

The SQL looks like this:

  Select from Selection * and insertion entry Entity_Guids e.g. E.D. = Such as NTTK where with. Gadu in (subquiri)  

with benchmark API, it seems impossible.

  Icricetia query = session. Seat seriatia (typef (unit), "e"). Add (sub-E ("e. Guides", subquery))  

throws an exception.

Your query will not work because the guides property given for the equote is not a single value You are actually trying to make an intersection and check that the intersection is not empty, which is unfortunately not present in the Criteria API, although you may possibly do this with a Linux.

You probably still do that if your gates were institutions with appropriate assets (the actual property in the value property) and were related to a bidirectional:

  Var subquery2 = isolated variable For & lt; GuidEntity & gt; (). Add (Subqueries.In ("Value", subquery) SETProjection ("Entity_FK"); IcTertia Query = Session.Create Citizenia (typef (unit)) Add (in subcategories ("ID", subquery 2)); < / Code> 

Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -