-->
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.  [ 3 posts ] 
Author Message
 Post subject: Implementation of Criteria.CreateCriteria
PostPosted: Fri Jul 08, 2005 2:51 pm 
Newbie

Joined: Mon Jun 27, 2005 12:06 am
Posts: 18
Location: San Francisco, CA
Hey,

as of 0.8.4, the implementation of Criteria.CreateCriteria is missing. What I would like to achieve with is that I would want to sort the order the entities in a one-to-many relationship are outer joined.

The example code would be:
Code:
session.CreateCriteria(typeof(Parent))
       .SetFetchMode("Children", FetchMode.Eager)
       .CreateCriteria("Children")
            .AddOrder(Order.Desc("Value"))
       .List()


Maybe I would also have to call AddOrder for the root criteria so that the Parent object's rows stay together, such as:
Code:
session.CreateCriteria(typeof(Parent))
           .AddOrder(Order.Asc("Id"))
           .SetFetchMode("Children", FetchMode.Eager)
           .CreateCriteria("Children")
                    .AddOrder(Order.Desc("Value"))
           .List()


but this is just a minor detail.
Is there any other way to tell NHibernate how to sort the outer joined entities? Of course my relationship is mapped as lazy and it has the order-by attribute but in this case, I'm eagerly loading it and that attribute is not taken into account here (afaik).

Thanks,
RGab


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 08, 2005 7:46 am 
Senior
Senior

Joined: Thu Aug 25, 2005 3:35 am
Posts: 160
Bump

I have the exact same question.
I actually want to get entities whoms collections are filled only with entities of a given sub-type.

Maybe this post belongs in general-usage forum.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Sep 10, 2005 4:26 am 
Senior
Senior

Joined: Sat Sep 10, 2005 3:46 pm
Posts: 178
I'd really like to get this feature implemented as well. How can we move features into the development pipeline?


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

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.