programatically modify llblgenproj file (database name or add entities)

Posts   
 
    
virginia
User
Posts: 27
Joined: 29-Nov-2016
# Posted on: 13-Jun-2017 12:08:09   

I have a database (and llblgen project) for trunk (T) and a database (and llblgen project) for the main branch (B). Periodically I have to migrate from trunk to branch (programatically). The databases at that point will have an identical structure, but the llblgen project for trunk will have more definitions.

This means either

A) create a copy of project T and change only its database name

B) update catalog for project R, search for all entities, stored procedures etc that are not added to the entity model and that are added to the entity model of T, and add them (with all their mappings and details)

With a waaaay older version of LLBLGen I had implemented method B, but there have been too many changes since to be able to reuse the code, so could you advise me on which way is easyer, and give me some pointers? Thanks

(using LLBLGen Pro v5.0, Ora11 and Sql Server 2005 databases, custom type converters)

Walaa avatar
Walaa
Support Team
Posts: 14950
Joined: 21-Aug-2005
# Posted on: 13-Jun-2017 17:43:45   

If both databases have the same structure, then why do you want to modify the database name for project B (copied from T) ?

Please note that at runtime or at production, the generated code can target a different database name, provided the schema is the same.

virginia
User
Posts: 27
Joined: 29-Nov-2016
# Posted on: 14-Jun-2017 10:03:41   

Mainly to make it easier for the person responsible for making changes to the llblgen projects (who has made mistakes before wink ). The schemas are only identical at specific moments. So on one hand spend a couple of hours of coding once, on the other hand take an extra 5 minutes to check if it's the right database for every change... I'll take the first option is possible smile , but if it's too complicated we'll do what you recommend.

Walaa avatar
Walaa
Support Team
Posts: 14950
Joined: 21-Aug-2005
# Posted on: 14-Jun-2017 19:40:12   

The llblgenproj file is an XML file. So you can find and replace the database name, programmatically, if that's what you want to do.

Open and the file and search, you will find the database name present in the Catalog Name inside the Catalogs tag, and then in the Mappings tags... (EntityMappings, SP..., TypedViews...).