Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JPA cascade ?

 
Edward Chen
Ranch Hand
Posts: 798
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using JPA + hibernate + Spring, but looks like the Cascade doesn't work.

Please see the coding, what I expect is, "John" is deleted, "Mary" is added. But I try all javax.persistence.CascadeType, it will NOT give me the result. Then I try to use org.hibernate.annotations.CascadeType, it will always give me syntax error.

Where is the problem ?

Thanks.

 
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Posts: 4968
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Does that tell Hibernate to delete the entity, or to just remove the association between the company and the employee? If you just deleted the Employee, rather than removing it from the list, the data would die. Thoughts?

-Cameron McKenzie
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic