Hibernate (Java) Question:

Download Job Interview Questions and Answers PDF

Define cascade and inverse option in one-many mapping?

Hibernate Interview Question
Hibernate Interview Question

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?