0 Replies Latest reply on Oct 17, 2002 10:47 AM by Tom Lauren

    foreign key of zero problem?

    Tom Lauren Newbie

      I've noticed that when using JBoss 3.0.0 with MySQL and I have a many-to-one bidirectional relationship, and the primary key of the one-side of the relationship is a long (or BIGINT in MySQL) of value zero, the foreign key on the many-side of the relationship gets a value of null instead of zero when I call the set method for the relationship field on the many-side. When the primary key of the one-side of the relationship has any value other than zero then the set method works fine (the foreign key on the many side gets the correct value). I've temporarily avoided this problem by not allowing any primary keys in my database to hold the value zero. Has anyone been able to establish a many-to-one bidirectional relationship where the primary key of the one-side is a long of value zero?