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 use the following naming conventions from a legacy database: All table names and field names are in UPPER CASE all foreign keys end in ID (xxxxID as postfix) ... all _ are removed and all table names and field names are lowercase with a first letter in capital created by Lightspeed ... this all works fine and the names are translated by lightspeed properly for the sql command ... UNTIL I have used two joins and then Lightspeed started to get mixed up with internal and external names. One table was entered in the model and a foreign key field was not created.. when I enetered the tables into the model in a different order the field was created properly and the join worked ... still in the final command are lower case names, which is ojk with the db unless one uses a foreign key field .. I have looked at the generated commands and depending on the order in which the tables were pulled into the model I get different results ... for example: one version of the generated sql CommandText "SELECT\r\n t0.RECORDID AS \"t0.RECORDID\",\r\n t0.CHANGEDON AS \"t0.CHANGEDON\",\r\n t0.CHANGEDBYID AS \"t0.CHANGEDBYID\",\r\n t0.Isalive AS \"t0.Isalive\",\r\n t0.LocationId AS \"t0.LocationId\",\r\n t0.Name AS \"t0.Name\",\r\n t0.Observationpointtype AS \"t0.Observationpointtype\",\r\n t0.Status AS \"t0.Status\",\r\n t0.Subtitle AS \"t0.Subtitle\",\r\n t1.RECORDID AS \"t1.RECORDID\",\r\n t1.CHANGEDON AS \"t1.CHANGEDON\",\r\n t1.CHANGEDBYID AS \"t1.CHANGEDBYID\",\r\n t1.GLOBALATTRIBUTESID AS \"t1.GLOBALATTRIBUTESID\",\r\n t1.LOCATIONTYPEID AS \"t1.LOCATIONTYPEID\",\r\n t1.Name AS \"t1.Name\",\r\n t1.Positioninfoxml AS \"t1.Positioninfoxml\",\r\n t1.Subtitle AS \"t1.Subtitle\",\r\n t2.RECORDID AS \"t2.RECORDID\",\r\n t2.CHANGEDON AS \"t2.CHANGEDON\",\r\n t2.CHANGEDBYID AS \"t2.CHANGEDBYID\",\r\n t2.Defaultaritask AS \"t2.Defaultaritask\",\r\n t2.Hasgpslocation AS \"t2.Hasgpslocation\",\r\n t2.Isleaf AS \"t2.Isleaf\",\r\n t2.Isobservationpoint AS \"t2.Isobservationpoint\",\r\n t2.Isroot AS \"t2.Isroot\",\r\n t2.Name AS \"t2.Name\",\r\n t2.Subtitle AS \"t2.Subtitle\"\r\nFROM\r\n Virtualobservationpoint t0\r\n CROSS JOIN\r\n Locationtype t2\r\nINNER JOIN\r\n Location t1\r\nON\r\n t0.LocationId = t1.RECORDID" string and now a different version: the difference is that the tables were deleted in the model and added in a different order, which in my book should not make any difference: CommandText "SELECT\r\n t0.RECORDID AS \"t0.RECORDID\",\r\n t0.CHANGEDON AS \"t0.CHANGEDON\",\r\n t0.CHANGEDBYID AS \"t0.CHANGEDBYID\",\r\n t0.Isalive AS \"t0.Isalive\",\r\n t0.LOCATIONID AS \"t0.LOCATIONID\",\r\n t0.Name AS \"t0.Name\",\r\n t0.Observationpointtype AS \"t0.Observationpointtype\",\r\n t0.Status AS \"t0.Status\",\r\n t0.Subtitle AS \"t0.Subtitle\",\r\n t1.RECORDID AS \"t1.RECORDID\",\r\n t1.CHANGEDON AS \"t1.CHANGEDON\",\r\n t1.CHANGEDBYID AS \"t1.CHANGEDBYID\",\r\n t1.GLOBALATTRIBUTESID AS \"t1.GLOBALATTRIBUTESID\",\r\n t1.LOCATIONTYPEID AS \"t1.LOCATIONTYPEID\",\r\n t1.Name AS \"t1.Name\",\r\n t1.Positioninfoxml AS \"t1.Positioninfoxml\",\r\n t1.Subtitle AS \"t1.Subtitle\",\r\n t2.RECORDID AS \"t2.RECORDID\",\r\n t2.CHANGEDON AS \"t2.CHANGEDON\",\r\n t2.CHANGEDBYID AS \"t2.CHANGEDBYID\",\r\n t2.Defaultaritask AS \"t2.Defaultaritask\",\r\n t2.Hasgpslocation AS \"t2.Hasgpslocation\",\r\n t2.Isleaf AS \"t2.Isleaf\",\r\n t2.Isobservationpoint AS \"t2.Isobservationpoint\",\r\n t2.Isroot AS \"t2.Isroot\",\r\n t2.Name AS \"t2.Name\",\r\n t2.Subtitle AS \"t2.Subtitle\"\r\nFROM\r\n Virtualobservationpoint t0\r\n CROSS JOIN\r\n Locationtype t2\r\nINNER JOIN\r\n Location t1\r\nON\r\n t0.LOCATION_ID = t1.RECORDID" string note the lower case field names.. these are created by Lightspeed and when this falls onto a foreign key field the quesry goes pear shape. regards gmd |
|
|
above is all wrong because the forum software takes all __ underscores out ... so all ID was underscoreID regards gmd |
|
|
Can you check that the ColumnName is set correctly for the entity properties where you believe the incorrect translation is occuring and assuming that it is can you please send through a small repro project which we can use to debug this and try and track down the cause of the issue.
|
|