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
|
Is it possible to have an Entity with a one-to-many relationship to a Value Object? For example, I have a Value Object for "PostalAddress" that holds address, city/town, country, etc. I have a "Customer" Entity and the Customer should be able to have multiple PostalAddress Value Objects (each customer can store multiple addresses in their address book). What is the correct/best way to model this scenario? Thanks. |
|
|
No, this is not possible. Recall that, in LightSpeed, value objects are stored in the columns of the entity table e.g. CREATE TABLE Customer ( Because a relational table cannot have an arbitrary number of columns, an entity cannot have an open-ended colluection of value objects. You will therefore need to model the associated objects as entities. |
|