0 Replies Latest reply on May 10, 2005 11:39 AM by christianspiteri

    Referential Integrity - CMP - remove()

    christianspiteri

      I have 2 CMP beans Candidate and Country. The candidate table has a foreign key country_id with "on delete restrict" set. However when I delete an entry (using the entity bean remove() method) from the country table, the respective foreign key in candidate is set to null and the country is deleted. Is this normal? I cannot delete the same country directly from the database because I get a "foreign key constraint fails" (which is what is supposed to happen).

      I am using mySQL/InnoDB database and JBoss 4.0.1

      cheers,
      c