Quote:
How can you be sure null and 0 would be the same thing for this particular instance? Perhaps the integer column represents a foreign key and the '0' record is definitely different than one that is null.
I would say that the safe bet would be to assume that null is never the same as 0 ;)
i.e. in retail if you get a null price or tax back out of the database you would probably want to handle it differently than if it were 0. i.e. maybe it really is free or has no tax on it vs being undefined (null)
You absolutely right about foreign keys and the price.
But in this particular case integer value is mapping to int type.
That meants no null value is possible.
I can see two ways to solve the problem.
1) tune up the database to reflect your code
2) tune up your code to reflect the database
I suggested the first one, because he might see some other aspects of this integer field when he try to default it to null. And it might turn him to second solution, hopefully he will get it right :)