Typedview Name on a Stored Procedure

Posts   
 
    
hotmail
User
Posts: 47
Joined: 06-Feb-2013
# Posted on: 07-Jul-2017 09:23:40   

Hello, using v5.2 latest, sql server 2016

When i Reverse-engineer Resultset to TypedView on a Stored Procedure the TypedView name is set as [Stored Procedure +Result]. How can i change this pattern to my own naming pattern?

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 08-Jul-2017 09:19:33   

hotmail wrote:

When i Reverse-engineer Resultset to TypedView on a Stored Procedure the TypedView name is set as [Stored Procedure +Result]. How can i change this pattern to my own naming pattern?

Go to Project -> Settings -> Conventions -> Entity Model -> Element Name Construction

In there, go to Typed view mapped on resulset pattern setting. The current value is:

{$ProcFunctionName}{$ResultsetName}Result

... then change it for you own pattern.

More info at: Name Construction, Name Patterns.

David Elizondo | LLBLGen Support Team
hotmail
User
Posts: 47
Joined: 06-Feb-2013
# Posted on: 10-Jul-2017 08:27:43   

Hello, i tried it but ran into an issue (may be a bug?). All my Retrieval stored procedure has following name pattern Sp+EntityName+Sel, for example SpOrganizationSel, and i am using reverse engineer resultsets to typed view, while i want the same name for retrieval stored procedure, i want my Typed View to be named Tv+EntityName . i basically want to strip prifix Sp and suffix Sel).

when i set the value {Sp}{} in Typed view name strip pattern, it does not strip Sp in my Typed View name. This only seem to work if i set the value {pr, sp, Sp}{} in Stored proc name strip pattern, but this will strip Sp from both Typed View and Stored procedure.

how do i strip Sp only from the Typed View? Also it seems like when i remove Row from the Template it still creates file with a Row in it. and QueryFactory Projection assumes a Row in the class name. is there an easier method to this?

All i want is a file name same as class name, and the class name that strips Sp and Sel from above Stored Procedure naming convention.

Thanks

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39588
Joined: 17-Aug-2003
# Posted on: 10-Jul-2017 17:17:52   

hotmail wrote:

Hello, i tried it but ran into an issue (may be a bug?). All my Retrieval stored procedure has following name pattern Sp+EntityName+Sel, for example SpOrganizationSel, and i am using reverse engineer resultsets to typed view, while i want the same name for retrieval stored procedure, i want my Typed View to be named Tv+EntityName . i basically want to strip prifix Sp and suffix Sel).

when i set the value {Sp}{} in Typed view name strip pattern, it does not strip Sp in my Typed View name. This only seem to work if i set the value {pr, sp, Sp}{} in Stored proc name strip pattern, but this will strip Sp from both Typed View and Stored procedure.

how do i strip Sp only from the Typed View?

This isn't supported currently, but it should indeed do so. The strip patterns for procs are applied when an SP Call is created, but it should be applied also in this case. It's an oversight. We'll see if we can fix it in 5.2.2 otherwise we'll postpone it.

Also it seems like when i remove Row from the Template it still creates file with a Row in it. and QueryFactory Projection assumes a Row in the class name. is there an easier method to this?

All i want is a file name same as class name, and the class name that strips Sp and Sel from above Stored Procedure naming convention.

The 'Row' is a suffix we'd recommend to keep. If you want to have a file name without 'row' you have to alter the preset, not the template: the preset dictates the filename.

Our tasks are defined in the .tasks files which define the default parameters. If you want to override the parameter value for the typedview task, add the following parameter to the

<taskPreset name="SD.Tasks.Generic.TypedViewPocoRowClassGenerator">

task

<parameter name="filenameFormat" value="[elementName].[extension]"/>

You can do that by opening the preset view, select the right preset and click 'copy as new' to create a copy of the preset to alter.

Frans Bouma | Lead developer LLBLGen Pro
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39588
Joined: 17-Aug-2003
# Posted on: 11-Jul-2017 12:01:12   

The strip pattern for procs is applied properly to all stored procedure names. I misread your statement, I thought it wasn't applied when the proc name was used in a typed view mapped onto a resultset, but it is.

So the pattern for a typedview onto a stored proc resultset contains the macro for the stored proc name, but that stored proc name is created using the strip pattern for stored procedures.

This thus means if you want to have 'Sp' stripped off only for typed views this won't work, it's stripped off for stored procs regardless, as it's part of the stored proc name strip patterns.

So what you want isn't supported.

Frans Bouma | Lead developer LLBLGen Pro