gfrankol wrote:
Ok so we tried a few things and the problems are:
- We cannot change the field to number(38,0) because those fields are PK and FK and not empty.
And the same problem is with our views (there are around 300 of those).
So changing the field definitions and view definitions are out of the question.
We could manually change the scale to 0 but after generating the code the scale in our code is still scale 38, for some reason the designer does not see the change to 0.
Any idea why is that?
Because the table field in the relational model data is NUMBER(38, 3 , and before code generation it syncs with the relational model data. In v5 we overhauled this system so sync is only done when you want to, and also in the direction you specify (so model first projects don't do a relational model data -> entity model sync).
But why not leave the scale at 38? It's ignored anyway by the generated code as the types are System.Decimal, a type which doesn't have precision/scale set.
- All of our views now have wrong isoptional flag values, some are all off, some are all on, and some have mixed on and off.
In 2.5 we manually set the isnullable flag for view fields which translated to isoptional on convert fine, but after refresh, the flag is reset to wrong values.
This happens only after updating the designer to the latest 4.2 build, when we had the August 2nd, 2015 build, the isoptional flag was fine after refresh.
This has been changed in December 2015:
See http://www.llblgen.com/Pages/ChangelogBrowser.aspx (select llblgen pro v4.2 and designer 4.2)
Catalog Refresher: If an element was mapped onto a view, IsOptional values for fields of the element weren't synced with the mapped target view's fields's Nullable values. This was by design. This has been changed to sync IsOptional with Nullable during a refresh of the catalog metadata if the element field's IsOptional value was equal to the target field's Nullable value. Previously this sync was only performed for tables, not views. As before for tables, if the element's field's IsOptional value differs from the old target field's Nullable value (so the user has changed the value of IsOptional at some point) the new view's field's Nullable value is ignored, to prevent overwriting a manual change.
This change was necessary as it made using views for entities not usable otherwise. In your case, the IsOptional flag in the entity mapped on the view is equal to the old view's IsNullable value. This means it will be synced (as it hasn't been manually changed). Then you refresh and the IsNullable flag for the field in the view is changed and as it is synced, the entity field is updated.
The 'IsNullable' flag for the view field has changed otherwise the entity field wouldn't be changed. Is this the case?
We are starting to consider to revert the project back to llblgen 2.5 since everything was fine with that build.
Only thing I see we can do to not revert is to go through all the views and some tables (again, over 300) and set the isoptional flag and scale manually but only if we can fix the problem with manual scale change not registering in our code.
I think you can safely ignore the scale issue, and generate code with precision/scale 38/38. The isoptional flags are coming from the DB meta data.
The issue with these are however that databases don't always update the metadata for a view if the underlying tables change, only when e.g. the view is dropped/recreated. this could lead to situations where a view which simply does Select * from Table, would show e.g. all fields are not nullable, however when the nullability for some fields in Table is changed, the view would still show 'all fields not nullable'.