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
|
First does an association need to exist in the database will lightspeed perform the association by itself. Second the designer thinks my OnetoOne association is a one to many |
|
|
1. At runtime LightSpeed will perform the association by itself. This is the case for one-to-many associations as well. The designer will only infer an association if there is a foreign key, but you can of course still create the association manually. 2. The designer has no way of knowing whether a foreign key represents a one-to-many or one-to-one association. Because one-to-many associations are more common in relational scenarios, the designer always infers one-to-many. Therefore one-to-one associations must always be added manually, whereas one-to-many associations can usually be created by dragging tables. |
|
|
Perhaps the designer could look for a unique index/key on the foriegn key |
|
|
I've logged a feature request for this -- thanks for the suggestion. |
|
|
Is there been any changes regarding this feature? I also have a relation from one table to another with a relation with a unique key constraint and when I try to use the "Update from source" of the designer or try to add the table again in the surface of the designer, the relation that is automatically added is "OneToMany" instead of "OneToOne". Must I delete and add the OneToOne relation manually? Am I correct when say that the table from where I start dragging the relation OneToOne is the table that will contains the field linked with the relation in my database? I've read it on page 36 of the LightSpeed User Guide but it's just to be sure. Thank you. |
|
|
You can convert the inferred one-to-many to a one-to-one by right-clicking the one-to-many arrow and choosing Convert to One-to-One Association. This will preserve which end contains the foreign key field. |
|