-
Notifications
You must be signed in to change notification settings - Fork 872
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Default value and creation of new document #4535
Comments
IMHO pre-populating ODocument with default values is a good solution. I just have to check how it will affect backward compatibility. |
:+1 |
Guys, please consider PR. All tests are OK. |
The call to the populateDefaultValues() should be done also on setClass() and setClassname() right? |
My idea was that once document created we can do with the object what ever we want, but fields values remains the same. Other wise there are lots of additional questions like: what to do with the a prepopulated field if super class was changed? Clean it or keep it? What to do if new class has the same property by with some default value? And so on. |
The problem is that new ODocument() is semantically equivalent to: new ODocument().setClassname(<class>); And what about this?: new ODocument("ClassA").setClassname("ClassB"); |
My idea was that in case new ODocument().setClassname(<class>); document will not have default values, because class was defined after creation of a document, so population of default values should be explicitly invoked. In case new ODocument("ClassA").setClassname("ClassB"); document will have default values from ClassA and changing to ClassB will preserve already set values. If you disagree: just let me know proper way to resolve that. |
Default values prepopulation. For issue #4535
Seems to be fixed in #4552. Closing? |
Guys,
From common logic perspective
new ODocument(classA)
should already have all fields with default values prepopulated, but OrientDB requires storing of ODocument for population of default values. And more over: this done in strange for this taks method ODocument.validateField().I suggest:
So, what do you think?
The text was updated successfully, but these errors were encountered: