Creating Custom Properties

Posts   
 
    
BlueCell avatar
BlueCell
User
Posts: 83
Joined: 12-Jul-2004
# Posted on: 19-Dec-2004 18:44:08   

Not sure if this is a bug, but here it goes anyhow: In SQL Server I have given the value " Bla" to one of the Extended Property of a field in a table (to be more specific: the description field). Now inside the catalog explorer tab, in the LLBLGen Pro Editor, I walk down to that same field and I see the "# of custom properties" is set to 1. When viewing this custom property, by clicking the right mouse button and choose "View Custom Properties", I see this custom property and all is fine. But now I do the following: I am going to edit that same field inside the Project Explorer. So the selected line of the "Fields mapped on database fields"-grid is currently on that field and I am looking at the custom properties: There are none. What I understand from this is, that a "Refresh Catalog" does import the custom properties, but does not create them so that they are generated, e.g. you can only create custom properties inside the Editor and not from within SQL Server. I find this unexpected behavior, but as I said before, it might just be correct and intented.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 20-Dec-2004 10:06:34   

You have to switch on the setting "RetrieveDBCustomProperties" in the project properties, which is off by default, to get the custom properties into the entities, when the entities are created. This is not done by default, because a lot of users suddenly had very large projects due to massive data in the extended properties, inserted by designer tools...

Frans Bouma | Lead developer LLBLGen Pro
BlueCell avatar
BlueCell
User
Posts: 83
Joined: 12-Jul-2004
# Posted on: 22-Dec-2004 23:05:32   

I double-checked that it was checked and even when it was checked it did not create (import) the custom properties to be generated.

PS: Sorry for the late reply and the so many "checked" simple_smile

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 23-Dec-2004 09:25:35   

BlueCell wrote:

I double-checked that it was checked and even when it was checked it did not create (import) the custom properties to be generated.

PS: Sorry for the late reply and the so many "checked" simple_smile

When that option is checked, it will check the checkbox on the refresh catalog / create project dialogs for retrieving custom properties from the db into the catalog in the project. If that's never been done, the catalog items (e.g. the tables) don't contain the custom properties and your entities won't either. If that's done though and the tables in the catalog in the project do contain custom properties, these are added to NEW entities when the RetrieveDBCustomProperties setting is true.

Frans Bouma | Lead developer LLBLGen Pro
BlueCell avatar
BlueCell
User
Posts: 83
Joined: 12-Jul-2004
# Posted on: 23-Dec-2004 22:08:07   

Otis wrote:

If that's done though and the tables in the catalog in the project do contain custom properties, these are added to NEW entities when the RetrieveDBCustomProperties setting is true.

I have recreated the LLBLGen project and now it adds the custom properties simple_smile . All is fine now, except for that I find it rather unexpected that I had to recreate the LLBLGen project to get the custom properties in, instead of doing it with a retrieve catalog. In other words, why did you choose to not detect new custom properties when retrieving the catalog?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 23-Dec-2004 22:46:27   

Because custom properties could be changed in the entities and you don't want your changes to be overwritten. simple_smile Furthermore, custom properties are often a pain, as visual designers for databases often store large amounts of data in extended properties which end up in the entities and projects and bloath the project a lot.

Frans Bouma | Lead developer LLBLGen Pro
BlueCell avatar
BlueCell
User
Posts: 83
Joined: 12-Jul-2004
# Posted on: 24-Dec-2004 08:43:31   

That seems like a good reason to me wink . Thnx for your help Frans, have a nice X-mas and New Years Eve (and NO, you can't work on LLBLGen Pro on these dates sunglasses )!

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 24-Dec-2004 10:46:38   

simple_smile You too have a great christmas! simple_smile I'll try to do something else besides coding on these dates wink stuck_out_tongue_winking_eye

Frans Bouma | Lead developer LLBLGen Pro
Posts: 20
Joined: 02-Apr-2004
# Posted on: 30-Dec-2004 02:41:15   

Like BlueCell, I have found that, when custom properties have not been loaded when a project is created, I have to create a new project from scratch in order to add custom properties. In addition, I found that custom properties were not added to even to new entities added to the original project, even though I have the RetrieveDBCustomProperties option set to True.

The reasons given for not allowing custom properties to be updated from the database do not apply in my environment.

Otis wrote:

Custom properties are often a pain, as visual designers for databases often store large amounts of data in extended properties which end up in the entities and projects and bloat the project a lot.

I only have one property for each table and field: a Description. And I do want to include it in my project.

Otis wrote:

Custom properties could be changed in the entities and you don't want your changes to be overwritten.

I write my Description in a separate data modelling program, which then exports Description to the corresponding custom property on the database. I have no intention of updating the Description custom property in LLBLGen Pro.

I would like entity and field custom properties to be refreshed when I do a Refresh Catalog. I appreciate that this would not suit everyone. So it would be good if it could be provided as an optional feature.

As it stands, LLBLGen Pro's custom properties feature is of no use for my current requirements. Creating a new LLBLGen Pro project from scratch every time I change some descriptions with my data modelling tool is just not feasible.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 30-Dec-2004 09:14:21   

Ok, I'll add an option to the new refresher code which makes the refresher overwrite custom properties for entities using the new custom properties in the new catalog(s).

Frans Bouma | Lead developer LLBLGen Pro
Posts: 20
Joined: 02-Apr-2004
# Posted on: 30-Dec-2004 19:33:31   

Thanks!