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
|
For example, I have the following domain objects: class Customer has properties of
class Address has properteis of
and database looks like this: table Customer has columns of:
|
|
|
Normal
0
false
false
false
MicrosoftInternetExplorer4
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:"Table Normal";
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-parent:"";
mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
mso-para-margin:0cm;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:10.0pt;
font-family:"Times New Roman";
mso-fareast-font-family:"Times New Roman";
mso-ansi-language:#0400;
mso-fareast-language:#0400;
mso-bidi-language:#0400;}
I am currently evaluating LightSpeed to use in a project that will base on an existing database. Basically database is terrible but changing the database schema is too much work. So I want to know how flexible I can do the mapping between objects and tables with LightSpeed. I am also looking at NHibernate however I feel NHibernate isn’t suitable as it will take too long to get started for people who have never used NHibernate before. |
|
|
What happened with the encoding with my previous post... I am currently evaluating LightSpeed to use in a project that will base on an existing database. Basically database is terrible but changing the database schema is too much work. So I want to know how flexible I can do the mapping between objects and tables with LightSpeed. I am also looking at NHibernate however I feel NHibernate isn’t suitable as it will take too long to get started for people who have never used NHibernate before. |
|
|
Value object column naming conventions are described in the help file under Help Topics > LightSpeed > Conventions. To summarise, the name of the database column must be the name of the entity property plus the name of the value object property. In your example, the columns would be called AddressAddress1 and AddressAddress2. (The convention of prefixing the value object property name with the entity property name is to cope with the fact that a Customer entity might have multiple Addresses, but they have to be stuffed into the same database table.) You can override the "base" name using the ColumnAttribute e.g. [Column("My")] In this example LightSpeed would look for database columns named MyAddress1 and MyAddress2. So your scenario would be addressed by specifying a ColumnAttribute with an empty string. Unfortunately, we don't currently allow this (because it is invalid for normal, primitive-type fields). We can provide you with a fix for this which would allow you to use your existing schema -- let us know. One other caveat is that we don't currently support ColumnAttribute on value objects in the designer. Again, we can look at providing a fix for this if required. |
|