-->
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: DetachedCriteria
PostPosted: Sat Dec 10, 2005 6:24 pm 
Senior
Senior

Joined: Sat Sep 03, 2005 12:54 am
Posts: 139
Hi.

I am trying to find out the best way to have a generic Find method on my service layer classes that would accept multiple criteria expressions and return a list of entities.

The criteria API does everything I need but you have to create the criteria object from the session and could then call the .List mehtod directly from the UI...so why have the service layer at all!!?

I notice that the DetachedCriteria in Hib 3x would seem like a better option but that is probably a fair way off for NH I guess.

How is everyone else handling this problem? Do you create your own criteria API that gets translated into HQL or into NH criteria? Seems like a lot of work for not much gain! I am tempted to just use the current Criteria API and accept that the service layer is just a very thin wrapper to the .List method call!!

Thanks,

Jason


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 12, 2005 10:02 am 
Contributor
Contributor

Joined: Thu May 12, 2005 9:45 am
Posts: 593
Location: nhibernate.org
Here is a related topic: Keeping HQL out of the UI layer.

_________________
Pierre Henri Kuaté.
Get NHibernate in Action Now!


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 12, 2005 4:22 pm 
Senior
Senior

Joined: Sat Sep 03, 2005 12:54 am
Posts: 139
Thanks Pierre.

That thread is interesting although quite discouraging! Sounds like it is fairly tricky to create your own criteria class and have that converted into HQL and I am not overly keen to go down that path at this stage.

Cheers,

Jason


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.