Die meistgefragten Interviewfragen und Antworten sowie Online-Tests
Lernplattform fur Interviewvorbereitung, Online-Tests, Tutorials und Live-Ubungen

Baue deine Fahigkeiten mit fokussierten Lernpfaden, Probetests und interviewreifem Inhalt aus.

WithoutBook vereint themenbezogene Interviewfragen, Online-Ubungstests, Tutorials und Vergleichsleitfaden in einem responsiven Lernbereich.

Interview vorbereiten

Hibernate Interviewfragen und Antworten

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

Zum Wiederholen speichern

Speichere diesen Eintrag als Lesezeichen, markiere ihn als schwierig oder lege ihn in einem Wiederholungsset ab.

Meine Lernbibliothek offnen
Ist das hilfreich? Ja Nein

Am hilfreichsten laut Nutzern:

Copyright Ā© 2026, WithoutBook.