This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
I am testing Lightspeed 5 against a DB2 database and having trouble with table and field naming. DB2 likes to use all uppercase table and field names. When setting up an entity in the designer as Trip with property TripId, the table is created as TRIPS with a field TRIPID. I'd like to keep the same names in the database. I tried setting the context as:
with DB2NamingStrategy as:
The DB2NamingStrategy code is not accessed when Update Datebase is called. What am I doing wrong? Thanks |
|
|
INamingStrategy is only used for runtime name resolution and not by the designer. If you want to use a custom naming strategy in the designer you will need to implement a separate undocumented interface to cover this. Here are the steps you will need to take to implement this: Implementing the IDesignTimeNamingStrategy interface:
Using a design-time naming strategy in a model is not exposed in the UI so you need to edit the XML directly:
|
|
|
Thanks Jeremy, I had found a similar answer in your forum but nothing seems to happen when I tried this method. I don't suppose you have a solution to the problem of how to get DB2 to work with Lightspeed with mixed case table and field names? |
|
|
Just to confirm, this is only a problem with the designer? And at runtime you are able to quoteIdentifiers to appropriately wrap the identifier names so the casing is adhered to - is that correct? If so Ill need to look at adding in an option to the designer to support identifier quoting across all entities where desired.
|
|
|
I was having a lot of problems with case. We are at the start of a large project and need to get some prototyping done. So I have reverted to allowing DB2 to use all upper case as a temporary measure. I had quoteIdentifiers set and the runtime was having issues as I saw an error with "KEYTABLE.NextId", so there was something not right. I put quoteIdentifiers to false and DB2 handled things better. Before reverting to all upper case in the database, I got the test table to generate by setting the individual ColumnName to the desired value eg "TripId" (in quotes). I am working to move a legacy database and can generate the script for the datatable. So to test the Designer I generated a table with all upper case field names. Updating from source just gives the property names the same value eg field name SOMECOMPOSITENAME rather than SomeCompositeName. What would be great is some name generation setting that would be used in design time for Update from Source / Update database and would automatically fill in the ColumnName attribute on a property. I'd suggest something like: Mixed case; Property name - SomeFieldName; Field Name - SomeFieldName Upper case; Property name - SomeFieldName; Field Name - SOMEFIELDNAME UpperUnderscore; Property name - SomeFieldName; Field Name - SOME_FIELD_NAME Just an idea! Workarounds to do this would help. Thanks, John |
|