create business entities from stored procedures

Mar 3, 2008 at 3:09 PM
Is there any way that I can created business entities from stored procedures ? As of now I can just created from the tables and views ? I have a stored procedure that returns me columns from multiple tables is there a way I can work with this situation using repository factory ?

Thank you
Developer
Mar 18, 2008 at 8:04 PM


mayuresh wrote:
Is there any way that I can created business entities from stored procedures ? As of now I can just created from the tables and views ? I have a stored procedure that returns me columns from multiple tables is there a way I can work with this situation using repository factory ?

Thank you


When you say "create" business entitities from stored procedures, do you mean creating a class definition for the business entities from stored procedures? If that's what you mean, the answer is no - the factory does not support this scenario.

However if you mean instantiating a business entity and populating data based on the outputs of stored procedures, then the answer is yes (by using the create data repositories recipes).
Apr 15, 2008 at 10:56 AM
Actually there is a sort of workaround for this. If you create a view that matches the output of your stored procedure (i.e. same fields from the same tables) you can use this to generate your business entity from.
We've used this method extensively as all access to tables in our system goes through existing stored procedures and none of them seal with just a single table, the joys of a legacy database layout that has been normalized to the point of absurdity.
Hope this helps