-->
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.  [ 2 posts ] 
Author Message
 Post subject: Query by non persistent property
PostPosted: Tue Mar 04, 2008 5:28 pm 
Newbie

Joined: Tue Sep 18, 2007 10:35 am
Posts: 8
Why isn't this possible?

Code:
public bool IsFull
{
   get
   {
       return registrants.Count >= bookingLimit;
   }
}



Code:
session.CreateQuery("select from TrainingClass where IsFull = false")
                    .List<TrainingClass>();


Seems like it would be easy enough for nhibernate to do. Figure out which properties are non persistent and narrow down the retrieved collection based upon them. Otherwise I'm left with expressing the same business logic in two different ways using both HQL and the model. I know I can filter the collection myself but still it would be cleaner.[/code]


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 04, 2008 5:36 pm 
Regular
Regular

Joined: Wed Jan 25, 2006 1:11 am
Posts: 118
Location: Copenhagen, Denmark
What is the problem, im not quite sure i follow. What is it you want to achieve


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.