I have a table where the the parent object has an optional many-to-one relationship. The problem is that the table is setup to default the fkey column to 0.
I think you are using primitive type as your primary/foreign key columns in your object. If yes then try using wrapper classes. Because primitive types can't have default values as null.