TypedViewProjection in 5.4.1

Posts   
 
    
gvb
User
Posts: 19
Joined: 09-Nov-2014
# Posted on: 02-Jul-2018 17:44:29   

Hello support,

In LLBLGen 5.3x I'm using TypedViewProjection to create an editable List.

var result = RetrievalProcedures.FetchGetOrderLineListResultTypedView(dataAccessAdapter,new QueryFactory().GetGetOrderLineListResultTypedViewProjection(),ordernr);

How can I get a similar result in 5.4.1? I use the following code, but that creates a read only result

var result = new GetOrderLineListResultTypedView();
RetrievalProcedures.FetchGetOrderLineListResultTypedView(dataAccessAdapter, orderLineListResultTypedView, ordernr);

SQL Server 2016 DataAdapter 5.4 (5.4.1) RTM

Regards, Goos van Beek

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39613
Joined: 17-Aug-2003
# Posted on: 02-Jul-2018 18:07:59   

With 'readonly result' you mean, the datatable has its columns set to readonly?

Frans Bouma | Lead developer LLBLGen Pro
gvb
User
Posts: 19
Joined: 09-Nov-2014
# Posted on: 02-Jul-2018 18:26:03   

As far as I can see the columns have no setter

public System.Double ItemsShipped 
        {
            get { return IsItemsShippedNull() ? (System.Double)TypeDefaultValue.GetDefaultValue(typeof(System.Double)) : (System.Double)this[_parent.ItemsShippedColumn]; }
            set { this[_parent.ItemsShippedColumn] = value; }
        }
internal DataColumn ItemsShippedColumn 
        {
            get { return _columnItemsShipped; }
        }
Walaa avatar
Walaa
Support Team
Posts: 14950
Joined: 21-Aug-2005
# Posted on: 02-Jul-2018 21:02:42   

I believe you are comparing 2 different generated classes. For each TypeView there is the TypeView class and the Row Class.

e.g. OrderLineListResultTypedView & OrderLineListResultRow

The first has DataColumn properties for building the dataTable. The second has the properties you can send, corresponding to each field per row in the dataTable.

gvb
User
Posts: 19
Joined: 09-Nov-2014
# Posted on: 02-Jul-2018 21:15:20   

The problem is that I can't use my 5.3 code anymore.

var result = RetrievalProcedures.FetchGetOrderLineListResultTypedView(dataAccessAdapter,new QueryFactory().GetGetOrderLineListResultTypedViewProjection(),ordernr);

Cause an error in 5.4

the GetGetOrderLineListResultTypedViewProjection is not generated anymore(?) I didn't change anything in my project, except an update from 5.3 to 5.4.1

Walaa avatar
Walaa
Support Team
Posts: 14950
Joined: 21-Aug-2005
# Posted on: 02-Jul-2018 21:28:40   

It's generated in my test.

Get[Name]ResultTypedViewProjection()

Are you sure you are looking at the same TypedView, which is mapped to a StoredProcedure ResultSet?

gvb
User
Posts: 19
Joined: 09-Nov-2014
# Posted on: 02-Jul-2018 22:42:09   

In my 5.3 version only the [Name]ResultRow classes are generated, no [Name]ResultTypedView classes. The [Name]ResultTypedViewProjection is generated in the QueryFactory class.

In the 5.4 version, both the [Name]ResultRow and the [Name]ResultTypedView are generated, but there are no [Name]ResultTypedViewProjections in the QueryFactory class

gvb
User
Posts: 19
Joined: 09-Nov-2014
# Posted on: 03-Jul-2018 08:19:58   

In 5.3.1 the [Name]ResultRow is a serializable class, in 5.4.1. the [Name]ResultRow is a datarow class. See the attached png

Attachments
Filename File size Added on Approval
DifferenceResultRows.png 246,508 03-Jul-2018 08:20.24 Approved
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39613
Joined: 17-Aug-2003
# Posted on: 03-Jul-2018 10:24:12   

It looks like the 'Output type' setting for the typed view has been reset to Typed Datatable, instead of PocoWithQuerySpecQuery.

Did you change that, in the settings perhaps? Please first check the project settings -> Entity model -> LLBLGen Pro -> Typed view output type default.

Then the typed view in project explorer -> Edit -> Code gen. info tab -> Output type. the one in settings controls the default. so if that one is set to 'PocoWithQuerySpecQuery' then the one in the typedview is explicitly set to Typed datatable. If the one in the typed view is 'typed datatable' and so is the one in the settings, you can simply change the one in settings and that will change all typed views' output type to PocoWithQuerySpecQuery. Then regenerate the code and you should get back the poco classes.

Frans Bouma | Lead developer LLBLGen Pro
gvb
User
Posts: 19
Joined: 09-Nov-2014
# Posted on: 03-Jul-2018 13:57:25   

The 'Output Type' setting for the typed view has indeed been set to Typed Datatable instead of PocoWithQuerySpecQuery. The same for the Typed List.

As far as I know I didn't change those settings (I'm sure), I only upgraded my project from 5.3.1 to 5.4.1.

But the result of changing the setting to PocoWithQuerySpecQuery solved my problem! I'm very glad that you helped me solving this issue.

Thank You! Regards, Goos van Beek.

gvb
User
Posts: 19
Joined: 09-Nov-2014
# Posted on: 04-Jul-2018 16:39:25   

For each project I convert to 5.4.1, the settings are changed from PocoWithQuerySpecQuery to Typed Datatable.

Just to inform you.

Regards, Goos van Beek.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39613
Joined: 17-Aug-2003
# Posted on: 04-Jul-2018 18:04:27   

Thanks, we'll look into it! When I saw your initial post I tried to repro it with a project saved with v5.3 but that worked OK (the poco typedlist/views were kept as-is). We'll see if we can reproduce it.

Frans Bouma | Lead developer LLBLGen Pro
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39613
Joined: 17-Aug-2003
# Posted on: 05-Jul-2018 16:15:47   

I can't reproduce it. Created a new project in v5.3.6 (but any version after 5.1 will do), which has the default set to PocoWithQuerySpecQuery (as is the default since 5.2.0), so I changed the default in project settings -> LLBLGen Pro Runtime Framework to TypedDataTable for both typedlist and typedview. My typed lists and typedviews in the test project indeed now have TypedDataTable as output type. Save, reload, still OK. Then I load the project in v5.4.1, and nothing changes: the default is still TypedDataTable and the typedlists/views still have TypedDataTable as output type.

So is there something else you did perhaps?

Frans Bouma | Lead developer LLBLGen Pro
gvb
User
Posts: 19
Joined: 09-Nov-2014
# Posted on: 05-Jul-2018 16:40:41   

To be certain I did a test with a new created project.

  • Create a new 5.3.1 sql server project; default poco (which I want to use)
  • Copied the project file to a new fodler and opened it with 5.4.1
  • Poco has changed to TypedDataTable (which I don't want to use)

That's all what I do...

See the enclosed screenshots

gvb
User
Posts: 19
Joined: 09-Nov-2014
# Posted on: 05-Jul-2018 16:41:00   

screenshots

Attachments
Filename File size Added on Approval
PocoToDataTable.png 124,920 05-Jul-2018 16:51.43 Approved
Walaa avatar
Walaa
Support Team
Posts: 14950
Joined: 21-Aug-2005
# Posted on: 05-Jul-2018 20:19:52   

Reproduced.

Steps:

  • Open Designer v.5.3.2, create a project from SQL DB, map 2 views to TypedViews.
  • First TV output has PocoWithQuerySpecQuery as the output, I leave it as is.
  • I change the second TV output to PocoWithLinqQuery
  • Save the file and close the designer.
  • From Windows Explorer, I right click the saved file and Open with Designer v.5.4.0
  • First TV output has changed to TypedDataTable.
  • Second TV output has not changed (PocoWithLinqQuery).
  • Close the Designer, without changing anything and without saving.
  • Re-open the file in the Designer.5.3.2.
  • First TV output is the original PocoWithQuerySpecQuery.
  • Second TV output has not changed (PocoWithLinqQuery).
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39613
Joined: 17-Aug-2003
# Posted on: 06-Jul-2018 11:10:45   

Oh! I misinterpreted what you wanted flushed I thought you wanted to use the datatable, and it got reversed to the default.

Thanks Walaa, will look into it!

Frans Bouma | Lead developer LLBLGen Pro
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39613
Joined: 17-Aug-2003
# Posted on: 06-Jul-2018 11:23:11   

Indeed, the default changes... Looking into it. We use two types of defaults: the 'legacy' default and the current default, to make sure that old projects with different defaults use the 'legacy' defaults. I think this particular setting uses the legacy defaults while it shouldn't.

It's also happening with a new project created in v5.4.1 btw, so it's not something to do with a project from an older version.

Frans Bouma | Lead developer LLBLGen Pro
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39613
Joined: 17-Aug-2003
# Posted on: 06-Jul-2018 11:56:16   

Found it, fixing...

Frans Bouma | Lead developer LLBLGen Pro
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39613
Joined: 17-Aug-2003
# Posted on: 06-Jul-2018 12:22:34   

Please download the v5.4.1 RTM release to have this fixed. Thanks for reporting!

Frans Bouma | Lead developer LLBLGen Pro
gvb
User
Posts: 19
Joined: 09-Nov-2014
# Posted on: 06-Jul-2018 12:53:07   

Thanks for the support!