This is a migrated thread and some comments may be shown as answers.

Use Stored Procedures

5 Answers 132 Views
Getting Started
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Yuri
Top achievements
Rank 1
Yuri asked on 02 Oct 2009, 03:58 PM
Hi All!

How works Use Stored Procedures checkbox on Reverse mapping?
When I check this and click Generate & Save only db class generated..

And is there a way with class generation also  generate Add/Edit/Delete methods for that class based on stored procedures(for example generate Class1_Save function which is called stored procedure also generated by OpenAccess for updating data in db)?

Thanks & Best
Yuri

5 Answers, 1 is accepted

Sort by
0
Alexander
Telerik team
answered on 06 Oct 2009, 03:49 PM
Hi Yuri,

By default, Telerik OpenAccess ORM generates dynamically the SQL statements used for CRUD operations. The "Use Stored Procedures" option enables you to select a stored procedure which can be used to override the automatically generated SQL. The stored procedure can be created by OpenAccess as well, if necessary. For more details on how to achieve this, please take a look at this help topic.

Regarding your second question, it is not possible to automatically create Add / Edit / Delete methods in the class definition, as this functionality is handled by the IObjectScope. However, by using the option described above you are getting almost the same behavior - each class can use different stored procedure for particular write operation.

Greetings,
Alexander
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Yuri
Top achievements
Rank 1
answered on 07 Oct 2009, 08:43 AM
Hi Alexander,

Thank you for reply!

If I'm right when I check 'Use Stored Procedure' checkbox and choose '<Create Stored Procedure>' option the ORM should create stored procedures after clicking 'Generate & Save' button. So where I can find that stored procedures created by ORM?

Second question is clear.

Thanks & Best,
Yuri
0
Accepted
Alexander
Telerik team
answered on 08 Oct 2009, 06:28 AM
Hi Yuri,

If you select the '<Create Stored Procedure>'  option for certain operation, the stored procedure will be created in the database when you rebuild the project. Additionally, please verify that the UpdateDatabase property of the project containing the persistent classes is set to True. Otherwise the database would not be updated.

Kind regards,
Alexander
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Jason Maronge
Top achievements
Rank 1
answered on 24 Jan 2011, 11:02 PM
Is there a way to do this for all the tables at once?  I just started to use it and have 60 tables and would like the CRUD stuff to be done by stored procedures. 
0
Alexander
Telerik team
answered on 27 Jan 2011, 06:16 PM
Hello Jason,

I am afraid that at the moment there is no way to set this option globally for the whole model. You will have to set the option for each class separately. However, we will consider this as a feature request and add it to our backlog system.

Best wishes,
Alexander
the Telerik team
Accelerate your learning with industry's first Telerik OpenAccess ORM SDK. Download today.
Tags
Getting Started
Asked by
Yuri
Top achievements
Rank 1
Answers by
Alexander
Telerik team
Yuri
Top achievements
Rank 1
Jason Maronge
Top achievements
Rank 1
Share this question
or