Use Stored Procedures

6 posts, 1 answers
  1. Yuri
    Yuri avatar
    7 posts
    Member since:
    Jun 2009

    Posted 02 Oct 2009 Link to this post

    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
  2. Alexander
    Admin
    Alexander avatar
    727 posts

    Posted 06 Oct 2009 Link to this post

    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.
  3. DevCraft banner
  4. Yuri
    Yuri avatar
    7 posts
    Member since:
    Jun 2009

    Posted 07 Oct 2009 Link to this post

    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
  5. Answer
    Alexander
    Admin
    Alexander avatar
    727 posts

    Posted 08 Oct 2009 Link to this post

    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.
  6. Jason Maronge
    Jason Maronge avatar
    322 posts
    Member since:
    Jan 2005

    Posted 24 Jan 2011 Link to this post

    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. 
  7. Alexander
    Admin
    Alexander avatar
    727 posts

    Posted 27 Jan 2011 Link to this post

    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.
Back to Top
DevCraft banner