codemix/oriento — pull request #142 by udoklein-sap (2014-11-20 09:17:23+00:00)
Title: update property for mandatory and notNull

The current implementation checks if mandtory / notNull are true or false and then maps this to "true" or false like so: (property.mandatory ? 'true' : 'false'). However this implies that the string "false" will be mapped to "true". On the other side calling the driver to list the properties reports both mandatory and notNull as strings. So retrieving the properties and writing them back to the DB will always set mandatory and notNull to "true". It is also not consistent with the behaviour of the other properties which are concatenated as a string to the query statement. Replacing it with (property.mandatory ||'false') would map 1 to false (which mapped formerly to "true"). The suggested fix would map integers somewhat reasonable to "true" and "false". Null and undefined would map to "false". Strings would be just concatenated. It follows that "false" would now now map to "false" and "unreasonable input" would result in a db error.