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
|
I have a question, I am tranfering data between systems, I am effectively creating DTO objects to transfer the data. We use the UpdatedOn and DeletedOn to determine what needs to be transfered and what does not. At the receiving end, I perform a simple check to see if the Id exists, if not I create a new entity, I override the GenerateId() method to ensure the Id's sync on the different systems. If the Id exists, but the record is flag for deletion, we remove the Entity. This all works fine, the question is, if the Id exists, we need to update the values. What I want to know is, if I perform a BeginEdit(), set the entity Properties, then perform and EndEdit(), will it always update the UpdatedOn, even if actually none of the properties have different values. i.e before update the propery Member.Name = "Mark", in the set stage above we set Member.Name = "Mark", will it still update the UpdatedOn date? or will Lightspeed notice the values are the same and do nothing? Thanks for your help. |
|
|
UpdatedOn is updated at the point of saving changes, at the same time that LightSpeed generates the SQL UPDATE statement. It is NOT updated immediately as properties change or when you do an EndEdit() -- only when you call SaveChanges(). Setting a property to its existing value does NOT cause the entity to be marked as Modified. (I.e. yes, LightSpeed notices the values are the same and does nothing.) An entity which has had only "same value" setters will therefore remain in the Default state, and therefore will not be included in SaveChanges(), and therefore will not have its UpdatedOn updated. |
|
|
That is just what I wanted to hear. Great, Thanks |
|