Most asked top Interview Questions and Answers & Online Test
Education platform for interview prep, online tests, tutorials, and live practice

Build skills with focused learning paths, mock tests, and interview-ready content.

WithoutBook brings subject-wise interview questions, online practice tests, tutorials, and comparison guides into one responsive learning workspace.

Prepare Interview

Hibernate Interview Questions and Answers

Question: What does it mean to be inverse?
Answer: It informs hibernate to ignore that end of the relationship. If the one-to-many was marked as inverse, hibernate would create a child->parent relationship (child.getParent). If the one-to-many was marked as non-inverse then a child->parent relationship would be created.

In Hibernate, only the ā€œrelationship ownerā€ should maintain the relationship, and the ā€œinverseā€ keyword is created to defines which side is the owner to maintain the relationship. However the ā€œinverseā€ keyword itself is not verbose enough, I would suggest change the keyword to ā€œrelationship_ownerā€œ.

In short, inverse=ā€trueā€ means this is the relationship owner, and inverse=ā€falseā€ (default) means it’s not.

Suppose Stock is parent and StockDailyRecords is Child object.

Inverse keyword is applied in one to many relationship. Here’s the question, if save or update operation perform in ā€œStockā€ object, should it update the ā€œstockDailyRecordsā€ relationship?

1. inverse=ā€trueā€
If inverse=ā€trueā€ in the set variable, it means ā€œstock_daily_recordā€ is the relationship owner, so Stock will NOT UPDATE the relationship.

2. inverse=ā€falseā€
If inverse=ā€falseā€ (default) in the set variable, it means ā€œstockā€ is the relationship owner, and Stock will UPDATE the relationship.

If keyword ā€œinverseā€ is not define, the inverse = ā€œfalseā€ will be used, which is

Save For Revision

Bookmark this item, mark it difficult, or place it in a revision set.

Open My Learning Library
Is it helpful? Yes No

Most helpful rated by users:

Copyright Ā© 2026, WithoutBook.