How to map Stored Procedures

Feb 15, 2008 at 1:48 AM
How do I map the stored procedures into the Repository Factory ? When I did the "Create Business Entities from Database", I only see selection for Tables and Views, not Stored procedures.
Feb 15, 2008 at 1:51 PM
try with the proyect that you asigned as DataAccess, and generate repositories from business entities, you can also generate CRUD store Procs for yoyr entities

JPS
Feb 15, 2008 at 2:47 PM


esulisti wrote:
How do I map the stored procedures into the Repository Factory ? When I did the "Create Business Entities from Database", I only see selection for Tables and Views, not Stored procedures.

To map stored Procedures first "Create the Business entities from the Database" for your business entities project.

Then on your Data Access layer "Generate the Repository Classes for the Business entities" now you will be able to select the stored procedure for the repository classes via the edit Mapping dialog.

View these screencasts to get a better understanding of the how to use the Reository Factory.

http://www.pnpguidance.net/Screencast/RepositoryFactoryGuidancePackageCodeWalkthroughScreencast.aspx
http://www.pnpguidance.net/Screencast/CreateDataAccessLayerUsingRepositoryFactoryGuidancePackageScreencast.aspx

HTH
Jawahar
Feb 15, 2008 at 5:01 PM
Those screencasts are what I need... but the links are broken =(
Feb 15, 2008 at 5:23 PM


jawahar wrote:


esulisti wrote:
How do I map the stored procedures into the Repository Factory ? When I did the "Create Business Entities from Database", I only see selection for Tables and Views, not Stored procedures.

To map stored Procedures first "Create the Business entities from the Database" for your business entities project.

Then on your Data Access layer "Generate the Repository Classes for the Business entities" now you will be able to select the stored procedure for the repository classes via the edit Mapping dialog.

View these screencasts to get a better understanding of the how to use the Reository Factory.

http://www.pnpguidance.net/Screencast/RepositoryFactoryGuidancePackageCodeWalkthroughScreencast.aspx
http://www.pnpguidance.net/Screencast/CreateDataAccessLayerUsingRepositoryFactoryGuidancePackageScreencast.aspx

HTH
Jawahar


Thank you for the reply. You were refering to mapping the stored procedures for CRUD. I am trying to map existing custom stored procedures that we have on the database and these stored procs may not always have result set. I need to know how to execute these stored procs using the Repository Factory.

Thanks,
Eric.-
Mar 11, 2008 at 3:27 PM
I have the same requirement as Eric - using existing custom stored procedures with Repository Factory.

Any advice on how to do this? Thanks.
Developer
Mar 18, 2008 at 7:06 PM


lgloria wrote:
I have the same requirement as Eric - using existing custom stored procedures with Repository Factory.

Any advice on how to do this? Thanks.


To execute your existing stored proc, use the recipe to generate repository classes. Stored procs that don't have result sets are INSERT, UPDATE, or DELETE procedures I presume. The recipe allows you to do this, though you need to provide your INPUT parameters (using a Business Entity).