The EntitySpaces Community

Share and learn about the EntitySpaces Architecture.
Welcome to The EntitySpaces Community Sign in | Join | Help
in
Home Forums Photos

Stored Proc Generation for Views

Last post 07-24-2008, 1:13 PM by pritcham. 3 replies.
Sort Posts: Previous Next
  •  07-24-2008, 11:32 AM 10368

    Stored Proc Generation for Views

    Is there a way to generate SELECT SP's for views using ES2008?
  •  07-24-2008, 12:15 PM 10369 in reply to 10368

    Re: Stored Proc Generation for Views

    Hi

    I don't think there is a "built in" method of generating stored procs for views - I'm sure there's a valid reason for the decision behind that by the team, but....

    Putting together a template (MyGen or Codesmith) to create your select procs wouldn't be too difficult at all so that wouldn't be an issue, that wouldn't "solve" the issue completely though as the generated Load() and LoadAll()'s for views (in the "Generated" classes) are coded to use dynamic SQL so you would need to provide an Override in your "Custom" classes - I've just tested this against one of my views (created a quick "Select *" stored proc against a view, added a "LoadAll()" overload to my Custom class that uses the "esSqlAccessType.StoredProcedure" param and it worked fine - no other changes were made or needed to be made.

    So, in a nutshell, don't think it's built in, but it's really (really!) simple to DIY.

    Cheers

    Martin

  •  07-24-2008, 12:58 PM 10371 in reply to 10369

    Re: Stored Proc Generation for Views

    The reason we do not really generate procs for views is that views don't have primary keys and such ....
    EntitySpaces | Twitter | BLOG | Please honor our Software License
  •  07-24-2008, 1:13 PM 10372 in reply to 10371

    Re: Stored Proc Generation for Views

    Hi Mike

    I assumed it was based around that (or more precisely to do with views not generally being updatable) but Select procs would be easy enough for a user to add (using one of the sample skeleton templates as a base if they're not familiar with template design for example)

    Cheers

    Martin

View as RSS news feed in XML