Model first: auto mapping for GUID and bool

Posts   
 
    
ww
User
Posts: 83
Joined: 01-Oct-2004
# Posted on: 10-Jul-2019 22:53:24   

I'm using version 4.0 of the designer for this project. It was built database-first from a SQL Server database. Now I need to add Oracle support so I have to go add field mappings for every entity to Oracle tables. Auto-mapping doesn't work for GUID or bool, and I have a lot of those data types. For each one I have to manually add a field and select the TypeConverter to use. Is there some way I can tell the designer to always use CHAR(32) for GUID and number(1) for boolean and automate this?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39747
Joined: 17-Aug-2003
# Posted on: 11-Jul-2019 10:52:29   

Not in v4.0, we added default types per target database in 5.2.

However you can get very far. You can set up a type conversion for oracle in the project settings (which uses a type converter). So for boolean, you specify string as relational model type in the type conversion and select the boolean converter. Then specify 1 as the length in the filter.

Make sure you have set 'auto-assign type converters' to true in the entity model general settings in the project.

For Guid this is the same, but instead use a different converter and specify 32 as length

THEN do automap unmapped entities (right-click entities node in project explorer). This should create the proper target tables.

Frans Bouma | Lead developer LLBLGen Pro
ww
User
Posts: 83
Joined: 01-Oct-2004
# Posted on: 11-Jul-2019 22:50:38   

Thanks! I can't upgrade this application to 5.x yet, so your suggestions were helpful.

I had missed the Type Converters page in the settings. Also I missed the "Automap Unmapped Entities" command, which was the main thing I needed to save me a lot of time simple_smile

I tried your settings and auto-map still didn't set the type converter on the new mappings, but it at least created the database columns and mappings for these fields, which was more than it was doing before.

I had to write a program to check over the project file and make sure the table and column names were the same for both database engines, so I had that program set the type converters for me, too.

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 12-Jul-2019 08:58:32   

ww wrote:

I had missed the Type Converters page in the settings. Also I missed the "Automap Unmapped Entities" command, which was the main thing I needed to save me a lot of time

Good that worked

ww wrote:

I tried your settings and auto-map still didn't set the type converter on the new mappings, but it at least created the database columns and mappings for these fields, which was more than it was doing before.

You should evaluate how the rules for the type converters was created to make the auto assignation. Some times it's some rule (length for instance) that doesn't match.

ww wrote:

I had to write a program to check over the project file and make sure the table and column names were the same for both database engines, so I had that program set the type converters for me, too.

Good to know that you found a way simple_smile

David Elizondo | LLBLGen Support Team