New smallint datatype mapped to bool after syncing to database

Posts   
 
    
Posts: 14
Joined: 20-Apr-2016
# Posted on: 01-Nov-2016 11:53:56   

This happened with V5.0, never saw this behavior with 4.2.

  1. I added a new column "sequence" of type smallint
  2. Synchronized database to refresh model
  3. Column was added as type bool
Attachments
Filename File size Added on Approval
table-schema.PNG 15,513 01-Nov-2016 11:54.10 Approved
llblgen-pro-schema.PNG 18,244 01-Nov-2016 11:54.16 Approved
Walaa avatar
Walaa
Support Team
Posts: 14950
Joined: 21-Aug-2005
# Posted on: 01-Nov-2016 19:54:33   

I can reproduce it in one scenario.

I failed to reproduce it when adding a smallint to an existing table. So I created a new table with some smallint fields including the PK.

Only the PK is mapped as bool using a BooleanNumeric TypeConverter, which was assigned automatically.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 02-Nov-2016 10:22:18   

BigBossCard wrote:

This happened with V5.0, never saw this behavior with 4.2.

  1. I added a new column "sequence" of type smallint
  2. Synchronized database to refresh model
  3. Column was added as type bool

I can't reproduce it with a default project. (5.0.8 ). Type converters are added automatically but in case of reverse engineering / sync with DB, this is only done if a type conversion is defined. This type conversion, defined in the project settings, is then applied to make it easier to define fields of a given type.

You likely have defined a type conversion for Bool <-> numeric type converter defined for the relational model data .net type Int16, which is then automatically converted to bool using the defined type converter. This wasn't always done in 4.2. If you don't want to auto-assign type converters, either remove the type conversion, or uncheck 'Auto-assign type converter to field mapping' under 'Entity Model->General'

Frans Bouma | Lead developer LLBLGen Pro