B
Brendan McLoughlin
Hi,
I am looking for opinions and alternatives for handling
null values in a data object which reads a record from a
database table.
This object will have properties which will be populated
from the DB table columns, standard enough. But what
about the instance where a column could be null.
The strategy I have used before is to assign a known
value to a property where the DB column is null
(Integer.Minvalue for a property of type integer).
The object then knows that the property is really null
when the DB is being updated from the object,
Has anyone any better pattern for doing this, or
alternate design strategies,
Brendan
I am looking for opinions and alternatives for handling
null values in a data object which reads a record from a
database table.
This object will have properties which will be populated
from the DB table columns, standard enough. But what
about the instance where a column could be null.
The strategy I have used before is to assign a known
value to a property where the DB column is null
(Integer.Minvalue for a property of type integer).
The object then knows that the property is really null
when the DB is being updated from the object,
Has anyone any better pattern for doing this, or
alternate design strategies,
Brendan