Win a copy of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications this week in the Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

best practice with @OneToMany entity  RSS feed

David Spades
Ranch Hand
Posts: 348
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what is the best practice in hibernate parent child objects? lets say in this case a country may have several states. Is it recommended to annotate country class with cascade or exclude cascading behavior at all? the reason is because states and country may have their own data layers and services, and we "cascade" database operations via calls to those methods. Is this the best practice? or should we leave the cascading to hibernate? what are the pros and cons of each approach? or is there any other approach?
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!