any way to have llbl only access the DB using stored procs?

Posts   
 
    
mjcastillo
User
Posts: 10
Joined: 08-Feb-2007
# Posted on: 26-Jul-2007 23:02:52   

I know that LLBL generates dynamic queries when you carry out operations (e.g. pulling in a collection of entity objects, or saving an entity object). We were given a requirement that all DB access is done through stored procedures. Is there any way to still use LLBL, but not have it use dynamic queries? I should be more specific and say I want to use the entity objects and collections, but don't want dynamic sql generated. Is there a way to tell LLBL to only use stored procs? I can't imagine there is since I don't think it ships with a set of stored procedures that it would need to accomplish this. I know I can call stored procs using LLBL, but that's not going to give me the productivity increase I get from using the DB objects created by LLBL. If I can only access the DB using stored procs, is it even worth using LLBL? Thanks, Mike

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 27-Jul-2007 09:48:18   

There is no a built in way that let you do that automatically, but you can do the following, if you want:

  • Use the Adapter model
  • Write the SPs yourself in the database
  • Map those SPs as method calls with LLBLGen.
  • Using your own business layer, I imagine Update, Insert & Delete will be straight forward, calling some SPs and passing the appropriate parameters.
  • For Selects use projection to project the result set returned from SPs into Entity Collections.