I am using DBIx and am having some issues reading an object from DB that has a belongs_to relationship defined on an optional field. If the optional field is NULL in the DB, the accessor for reading the field attempts to create a new entry in the foreign table with blank/null values instead of (as I would like it) just returning undef.
Apart from not wanting blank values in the foreign table, the subsequent insert-by-side-effect calls will fail as a uniqueness constraint will be violated.
A sample scenario is a car table with an optional radio_type column which is either NULL or holds the foreign key of a radio_type table row.
I'm not sure if I am grappling with default well intentioned behaviour that can be disabled or have just made some basic error. Enlightenment appreciated.
In reply to DBIx, using belongs_to on optional field, insert-by-side-effect in foreign table by smallvaluesof2
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |