Sorry should be like this...
"All i want is that in the case when ID is 0 the Customer will be set to NULL and no exception will ..."
how can you set the id=0 if the object is null?
If you say nullable = false it means nullable = false. So the Customer can't be set to null. Remove it and alter table accordingly.
Yes you are right would be the cleanest way to do it..but fact is i cannot change the table ! there are 100 and more programs in RPB which are accessing this tables..
The definition of the table was done wrong 10 years ago and there are now a lto of programs which are working with exactly this table definition :(