Reverse engineer tables as entities

Posts   
 
    
WilliamB
User
Posts: 17
Joined: 10-Feb-2022
# Posted on: 13-Jun-2022 18:27:01   

Hello there,

I wanted to attempt to create an script that after calling the CliSyncWithDatabase utility, could refresh the Entity Model using reverse engineering and then just call CliGenerator to generate code consistent with changes made to the database.

The project will use LLBLGen Framework Pro(Self Service) and connects to an Oracle database using ODP. No issues here using the Designer or the CLI tools.

The problem is that I could not find a way to reverse engineer the tables to entities unless I use the Designer. I found some online references for the following classes:

  • CatalogModelGraph (library: SD.Tools.Algorithmia.dll)
  • ReverseEngineeringService ( library: SD.LLBLGen.Pro.ApplicationCore.dll)

...but I cannot find any examples of how to use them, the source of information I could find is the Reference Manual

I am not really sure if I am in the right path or if these libraries are meant to be used this way or how to proceed forward. Any help will be greatly appreciated


Thanks in advance

Walaa avatar
Walaa
Support Team
Posts: 14986
Joined: 21-Aug-2005
# Posted on: 13-Jun-2022 23:43:34   

You can do that by using from the Project Settings. Please check the Database First Development section under Entity Model.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39760
Joined: 17-Aug-2003
# Posted on: 14-Jun-2022 07:46:43   
Frans Bouma | Lead developer LLBLGen Pro
WilliamB
User
Posts: 17
Joined: 10-Feb-2022
# Posted on: 14-Jun-2022 20:00:22   

Thanks to both of you for your help. I am glad that the solution is way less complicated than I imagined.

On the same accord and considering the specific case of Oracle/ODP, how do you think we should proceed in order to link entity fields with a:

  • Sequence
  • TypeConverter

... without using the designer but just a PS script and/or a C# console app taking parameters?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39760
Joined: 17-Aug-2003
# Posted on: 15-Jun-2022 08:59:38   

For sequences you can specify a sequence matching pattern under Database First Development -> Reverse Engineering. If a sequence is found that's matching that pattern when reverse engineering it'll be assigned to the pk field with the same type.

For type converters, you have to define predefined type conversions for the type converter. You then also have to make sure the 'Auto assign type converter to field mapping' is checked under Entity Model -> General

Frans Bouma | Lead developer LLBLGen Pro