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 was planning to use an O/R mapper tool on my incoming project. During my research I came across to this site. I was so impressed when I looked on the samples and watched the video of LightSpeed. Then I start evaluating the tool.
However, after I generated the entities I've noticed that the table name was not indicated in TableAttribute of the entity. This gives an error in run-time. Did I missed something here?
By the way, I'm using the Express edition and I also tried the nightly build.
Regards,
jerwin
|
|
|
lsgen emits TableAttribute only if the table name does not match one of LightSpeed's standard naming conventions. The standard naming conventions are table name = class name (e.g. a Person table) and table name = plural of class name (e.g. a People table). So lsgen will usually need to emit TableAttribute only if you have a multipart name with separators, such as Order_Detail. What has probably happened in your case is that your table names are plural. In this case lsgen creates singular class names (e.g. Person for People) and does not emit TableAttribute. For this to work, however, you need to set LightSpeedContext.PluralizeTableNames = true. If this isn't the case, could you tell us the names of some of the tables that are being mishandled, the names of the classes being generated for them, and the erroneous SQL that LightSpeed emits when you try to perform a query (you can get at this by setting LightSpeedContext.Logger = new TraceLogger())? Thanks! |
|
|
Nice! All my tables are handled correctly when I set the PluralizeTableNames = true. Thanks Ivan!
|
|