| 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 
					
  
						
					 | 
				 
				 
			 |