-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: NHibernate.Linq query question
PostPosted: Mon Jan 12, 2009 4:43 am 
Newbie

Joined: Mon Jan 12, 2009 4:27 am
Posts: 1
I have a question regarding Linq queries using the latest bits from NHibernate Contrib project.

Is there someone who could tell me how to state a query using a join only for where conditions, eg.

from c in db.Customers
join o in db.Orders on c.CustomerID equals o.CustomerID
where o.OrderDate == DateTime.Today
select c;

As I understand it, the above query is not possible to run with the current version of NHibernate.Linq because of the join. My intention of the join is only to make it possible to use the other table in the where-clause. If I rewrite the query with a possible to run notation as follows:

from c in db.Customers
from o in c.Orders.Cast<Order>()
where o.OrderDate == DateTime.Today
select c;

makes Nhibernate do a join fetch in this query which was NOT my intention.

/Mats


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.