Win a copy of The Business Blockchain this week in the Cloud forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hibernate CascadeType.PERSIST and DELETE_ORPHAN

 
Kim Long
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

When i use these settings everything works fine :

@OneToMany(mappedBy="user",fetch=FetchType.EAGER,cascade = {CascadeType.PERSIST,CascadeType.MERGE})
@org.hibernate.annotations.Cascade(value={org.hibernate.annotations.CascadeType.DELETE_ORPHAN})

but when i delete the CascadeType.PERSIST and for example delete a member of my Collection it doesn't update the Database anymore when i synchronize it with merge. I don't understand this why do i have to set PERSIST too, that DELETE_ORPHAN works correctly?

thanks for your help

Mr. Long
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic