0 Replies Latest reply on Mar 8, 2006 1:57 AM by javatwo

    foreign key constraint violation

    javatwo

      @Entity
      class Department {
      ....
      }


      @Entity
      class Employee{

      @ManyToOne
      @NotFound(action=NotFoundAction.IGNORE)
      public Department getDepartment()

      }


      Employee table refers to department table (foreign key).
      When I tried to delete a department, I got an exception
      "foreign key constraint violation"

      I want Hibernate/database to ignore the constraints and delete the department. how?

      How to tell Hibernate not to generate the foreign key constraints?
      @NotFound(action=NotFoundAction.IGNORE) does not work for this purpose, only for reading, ignore when not found.


      Thank you very much for your help.
      Dave