Hibernate (Java) Question:
Download Questions PDF

Define cascade and inverse option in one-many mapping?

Answer:

cascade – enable operations to cascade to child entities.
cascade=”all|none|save-update|delete|all-delete-orphan”
inverse – mark this collection as the “inverse” end of a bidirectional association.
inverse=”true|false”
Essentially “inverse” indicates which end of a relationship should be ignored, so when persisting a parent who has a collection of children, should you ask the parent for its list of children, or ask the children who the parents are?

Download Hibernate Interview Questions And Answers PDF

Previous QuestionNext Question
How do you define sequence generated primary key in hibernate?What does it mean to be inverse?