Settings for direct db to C# mapping ?

Posts   
 
    
happyfirst
User
Posts: 215
Joined: 28-Nov-2008
# Posted on: 30-Sep-2015 15:22:54   

I want to have LLBL generate an exact matching layer for my database. I am running llbl from the command line. I've toggled various settings in the preferences to try and get llbl to stay in sync with my db, and it seems better, but still I find I am constantly needed to sync other things that I can't seem to find settings for.

For example, I changed a column datatype in my table (from a number to a string) and also in it's matching sql view, after my command line refresh and regenerate, llbl kept the original datatype. Also, optional flags. Depending on what I change in the db, it's to a point that llbl is getting tedious and I find it easier to remove the entity and then reverse engineer it again. But then for views, I need to readd my primary key columns.

I would like to know any settings such that llbl just ignore ANY differences and take what comes from the catalog.

I am making a lot of changes in the db and I don't want to customize anything about my data tier in llbl. I just want it to generate my c# layer to match exactly what comes out of the db. If my code breaks, awesome, I go and correct it since it will need that anyways.

Am I missing some master setting? If it's multiple settings what settings could I be missing that I need to turn on?

EDIT - There is one thing I am 'customizing' on the entity side. For view entities, I am setting the unique columns. I would like to have llbl sync and overwrite everything on the entity side and just try to preserve that one part of missing info

Walaa avatar
Walaa
Support Team
Posts: 14950
Joined: 21-Aug-2005
# Posted on: 30-Sep-2015 21:16:05   

All settings can be set once at the Project Settings

Which type of database are you using?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39613
Joined: 17-Aug-2003
# Posted on: 01-Oct-2015 09:40:33   

happyfirst wrote:

For example, I changed a column datatype in my table (from a number to a string) and also in it's matching sql view, after my command line refresh and regenerate, llbl kept the original datatype. Also, optional flags. Depending on what I change in the db, it's to a point that llbl is getting tedious and I find it easier to remove the entity and then reverse engineer it again. But then for views, I need to readd my primary key columns.

The problem here is sqlserver. If you have a view on a table with e.g. the query SELECT * FROM Table, and you change a column in Table, the view's metadata isn't changed. So when you refresh the catalog, the metadata returned from the DB is the same for the view. To make this work, you sadly have to open the view in SSMS in sql form and reapply the view (so the DB basically drops and re-adds the same view). The meta-data is then updated and refreshing the catalog will obtain the right meta-data.

Btw, for v5 the clirefresher has been removed as we re-implemented the synchronization system which is now more streamlined (so no more conflicts when you alter the model and you have to export some ddl sql script etc.). We might re-add it in the future, for now that's not the case.

EDIT - There is one thing I am 'customizing' on the entity side. For view entities, I am setting the unique columns. I would like to have llbl sync and overwrite everything on the entity side and just try to preserve that one part of missing info

What is 'unique columns', a unique constraint?

Frans Bouma | Lead developer LLBLGen Pro