As many of you already know, we are offering you a chance to choose which features of OpenAccess ORM you would like to see implemented in the next releases. You can post your votes and comments in our PITS system, plus you can ask us to put new features there through the support system or forums.
Recently there is one clear winner in PITS – the database default values support. It has been requested many times through our support system as well – and we would like to thank all of you for the feedback, we do appreciate it. We are glad to announce that this functionality is now in OpenAccess, and you can already have a look even before Q2 2012 by downloading our latest internal build (2012.1.427.1)!
What we have decided is that the columns containing default values will be marked with a Boolean flag, called HasDefaultValue. This flag, stored in your Domain Model, basically means “skip this column from the insert statement unless the value is specified explicitly” when set to True. In other words when you are adding a new object, if the value in a nullable column is NULL, the column will be excluded from the insert statement. In case the column is not nullable, defining the property mapped to it as nullable will achieve the same result.
In case you don’t want to use the database default value, just set the HasDefaultValue flag to False and initialize the value in your code .
Since the internal build is just a preview of this new functionality, now is a perfect time to take a look and comment on our approach. Is anything missing? Is everything working as expected or the behavior is not intuitive for you? Do not hesitate to provide both your positive and negative feedback!
Ivailo Ivanov is Team Lead in Telerik Data Access
Copyright © 2002-2016 Telerik. All rights reserved.
Powered by Telerik