No, you can't make Cartesian products with criteria.

BUT

you can use a subquery:

DetachedCriteria subquery = DetachedCriteria.For<MessageType>("mt")
  .SetProjection("id")
  .Add( /* more criteria */ );

ICriteria query = session.CreateCriteria(typeof(Message), "m")
  .Add(Subqueries.PropertyIn("m.id", subquery);

The limits of this approach is that you can't have any data returned
by the query that is not in Message. But you can filter by any data.

On 25 Mai, 13:24, zajda <[email protected]> wrote:
> Hi
>
> it is possible to do following using criteria:
>
> select m, mt from Message m, MessageType mt
> where m.TypeId = mt.Id
> and m.TypeId = 2
>
> Message and MessageType tables are not mapped together.
>
> Thanks in advance for your help.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to