• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 765
  • Last Modified:

inverse attribute in hibernate

Hi,

I would like to know when we use inverse attribute. I saw setting inverse=true within set property attribute while doing many-one, one-many association hibernate examples. any  ideas, suggestions, sample code, resources, links highly appreciated.thanks in advance
0
gudii9
Asked:
gudii9
  • 2
  • 2
  • 2
  • +1
3 Solutions
 
techsathishCommented:
This link will make you understand about the inverse with all you asked .. check it out and get a knowledege..

http://www.mkyong.com/hibernate/inverse-true-example-and-explanation/
0
 
Sathish David Kumar NCommented:
Invesre key word is used for relation ship mapping like one to many and many to many !

>>>>>>>>>I would like to know when we use inverse attributeto avoid un nessery updates  from the relation ship mapping  

when we wont use ?

child update themself that time only we didnt use inverse=true
0
 
Sathish David Kumar NCommented:
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
ioantonCommented:
Quotation from Hibernate docs:

"The rules are straightforward: all bi-directional associations need one side as inverse. In a one-to-many association it has to be the many-side, and in many-to-many association you can select either side."
0
 
gudii9Author Commented:
>>>In a one-to-many association it has to be the many-side, and in many-to-many association you can select either side

I have not clearly understood this. Can you please elaborate this.
0
 
ioantonCommented:
You can find here a more detailed description of the problem:

http://swik.net/itefforts/itefforts+blog/Understanding+%22inverse%22+mapping+attribute/bo772
0
 
gudii9Author Commented:
in above link i read like

>>>

What is “inverse”?

This is the most confusing keyword in Hibernate, at least i took quite a long time to understand what is it. The “inverse” keyword is always declared in one-to-many and many-to-many relationship (many-to-one doesn’t has inverse keyword), It defines which side is responsible to take care of the relationship.

Always put inverse=”true” in your collection variable?

There are many Hibernate articles try to explain the “inverse” with many Hibernate “official” jargon, which is very hard to understand (at least to me). In few articles, they even suggested that just forget about what is “inverse”, and always put the inverse=”true” in the collection variable. This statement is always true – “put inverse=true in collection variable”, but do not blindfold on it, try to understand the reason behind is essential to optimal your Hibernate performance.

“inverse”, can it change to “relationship owner”?


i still not clear on it. please advise
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 2
  • 2
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now