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
|
Hello, My entity has a DateTime property that has 'Load Only' set to true and 'Is Nullable' set to True. I notice that when insert statements are generated, the DateTime property is correctly ignored. My entity also has a String property with both 'Load Only' and 'Is Nullable' set to True. But the generated insert statement always includes the column, setting it to NULL (I do not set it at all). I would assume the column would not be included in the insert statement because it is set to 'Load Only'. This behavior is causing problems b/c the NULL value is overriding my default values for the column (Oracle). Am I missing something? Thanks
|
|
|
I'm not sure what is going on there -- Load Only should prevent the column from being included in INSERTs or UPDATEs regardless of data type. Is it possible that you have changed the string property to be manually implemented in the partial class? If so the backing field needs to be marked readonly. If that's not the case could you post a minimal repro? Thanks! |
|
|
Ivan, It turns out my entity property was named CreatedBy, and it was always included in the insert regardless of the Load Only setting. I changed the name of the property and the problem went away. I assume this is somehow related to the Lightspeed change tracking, which I know nothing about. But no worries, I'm good to go now.
|
|
|
Thanks for alerting us to this -- CreatedBy should only be given special treatment if you turn on auditing in the LightSpeed context, so we may have a bug here. I'll take a look at it, but glad you have a workaround for now. (In case you hit this again, other names which are special to LightSpeed are CreatedOn, UpdatedOn, DeletedOn, LockVersion and (if auditing is on) UpdatedBy and DeletedBy.) |
|