Srinivas
Srinivas

Reputation: 390

Foreign key ON UPDATE CASCADE in eclipselink

How to create a foreign key with ON UPDATE CASCADE in eclipselink. Can anyone explain how to create such foreign key

Is this feature available in eclipselink?

srini

Upvotes: 0

Views: 464

Answers (1)

Sai Ye Yan Naing Aye
Sai Ye Yan Naing Aye

Reputation: 6738

You can use these properties cascade = CascadeType.ALL or cascade = CascadeType.MERGE when you want to cascade update. see sample;

   @Entity
   class Employee {

      @OneToOne(cascade=CascadeType.ALL)
      private Address address;

  }

Upvotes: 1

Related Questions