1 Reply Latest reply on Aug 3, 2006 6:28 AM by Karol -

    Constraint generation problem

    Karol - Newbie

      Hi

      I have problem. Im new to EJB and I'm testing it. I'm using JBoss 4.0.4.GA-Patch1.
      I use following annotation to define relationship:

      @OneToOne(cascade=CascadeType.ALL, fetch=FetchType.EAGER, optional=false)
      @JoinColumn(name="firm_id", unique=true, nullable=false)
      public Firm getFirm() {
      return this.firm;
      }

      It works fine, but it generates such constraint under PostgreSQL 8.1 (no matter what CascadeType I use):

      CONSTRAINT fk6a68e0840801796 FOREIGN KEY (firm_id)
      REFERENCES firms (id) MATCH SIMPLE
      ON UPDATE NO ACTION ON DELETE NO ACTION,

      I'd like:
      ON DELETE CASCADE

      Am I doing something wrong?