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'd like to know if it's possible to map enity with multiple column key. If so how? And if not do you know any other way to achieve this condition: there can be no two rows a and b that both a.column1 == b.column1 and a.column2 == b.column2.
I'm new to the ORM subject, so i'm wondering does lightspeed need to know the other part of the key?
Thanks you for your answer in advance.
|
|
|
Hi Erxar, LightSpeed does not support composite keys. However, you should be able to handle your scenario by either: 1) Using a UNIQUE constraint in the database - if duplicates are rare and your happy to handle the database exception in your app. Or, 2) Creating a custom validator that works like the built in UniqueValidationRule class. i.e. Generate a simple LightSpeed count query to check for duplicates. Let me know if this makes sense. Andrew. |
|
|
Yes, that was helpfull. Thank you once again.
|
|