Monday, February 06, 2012 | |
LLBLGEN PRO Extended/Custom properties on table fields
Location: BlogsRT-blog    
Posted by: Ron Smith 12/2/2009 12:10 PM

Using extended/custom properties in LLBLGEN Pro is a bit confusing.  Here are some tips which I hope will save you time.

To view custom properties on an entity, right-click the entity  name in the project explorer and choose "Edit/Properties".  Choose the Code Gen. Options tab and then the Custom Properties tab.

To view custom properties on a entity field, right-click the entity  name in the project explorer and choose "Edit/Properties".  Choose the Entity Fields tab, select the field from the list of Mapped Entity Fields, then choose the Custom Properties tab.

By default LLBLGen does not import your custom properties which you define on fields or tables.  To enable this, go to the preferences screen and change the value of RetrieveDBCustomProperties to true.  When this value is false, LLBLGEN will not retrieve custom properties, even if you check the "Custom Properties" checkbox when creating a new project or refreshing a schema.

When creating a new project, if you check the box to retrieve "Custom properties", then LLBLGen will retrieve the properties for tables and their fields.  If you do not do this when creating a project then you will have to take an extra step to later retrieve the custom properties of your fields (explained below).

When you refresh a catalog, custom properties for entities and fields will not be updated, even if you check the "Custom Properties" checkbox. To update custom properties you must change the value of UpdateCustomPropertiesAfterRefresh to true (in Preferences).  The catch here is it will only update existing properties.  If you did not include custom properties when you created a project or you add a new property after the project was created, it will not get updated.  However, you can manually add the custom property to the entity or entity field, in which case it will then be updated on future refreshes of the catalog.

These settings are all defaulted this way so that projects don't grow excessively large as a result of custom property data inserted by third-party modelling tools. 

One way to use custom properties and avoid this problem is to change the preferences as indicated above.  When you create a project, do not include custom properties in the elements to be retrieved from the schema.  Edit your entities and either manually put in the custom properties you'd like to include or use the "Add Custom properties" plugin.  This is useful if all your custom properties are named the same in each field.  For instance if each field has a "Description" property, use the plug-in to add a "Description" property to each field.  When you next update the project schema and include custom properties, the values for "Description" will be pulled from the database, but other custom properties will be ignored.  The plug-in can be access by right-clicking on the entity name in the project explorer and choosing "Run Plug-in".

Alternatively, you could include all the properties when you first create the project and delete the ones you do not want to keep in the project.  The remaining custom properties will be refreshed when you want them to and the deleted properties will be ignored.

LLBLGen Pro v2.6, Custom properties, extended properties

 

Permalink |  Trackback

Your name:
Title:
Comment:
Security Code
Enter the code shown above in the box below
Add Comment   Cancel 
Search
Archive
Copyright 2009 Real Technology | Terms Of Use | Privacy Statement Home | RT-Blog | Contact Us | About RT