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
|
Hi, I am in the process of evaluating different OR/M tool and found this promising too. I am not sure from the documentation if LightSpeed supports composite entity. We have a legacy database which had a lot of table with a translation table along with it. For example, we have a table called "REGION" and a table called "REGION_TL", REGION_TL basically contains the translated (english and french) values in REGION. The structure is like the following: REGION REGION_TL If I wanted to write a query that get columns in both table (ex. DESCRIPTION from REGION_TL and REGION_ID in REGION), how would I do it in lightspeed without making 2 calls to the database? the SQL way is this: select RT.DESCRIPTION, R.REGION_ID from REGION R, REGION_TL RT where R.REGION_ID = RT.REGION_ID
|
|
|
A LightSpeed entity cannot span two tables. However, you can use eager loading to load related data in a single trip to the database. E.g. you could have a Region entity and it could have a RegionTL property, but the RegionTL object would be eager loaded so that you would still only make one call to the database. However, LightSpeed would not be able to do this with your existing schema, because LightSpeed does not support composite keys, and would require REGION_TL to refer to REGION via a foreign key rather by sharing part of the primary key. You might be able to adapt the schema to LightSpeed conventions by using an updateable view but I'm not terribly optimistic: LightSpeed relies on the database structure following certain conventions, and the schema you describe for your legacy database may just be too different from what LightSpeed knows how to handle. |
|