Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

inverse attribute in hibernate

Posted on 2011-03-10
7
Medium Priority
?
747 Views
Last Modified: 2012-06-21
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
Comment
Question by:gudii9
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
  • +1
7 Comments
 
LVL 7

Accepted Solution

by:
techsathish earned 668 total points
ID: 35104894
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
 
LVL 20

Assisted Solution

by:Sathish David Kumar N
Sathish David  Kumar N earned 668 total points
ID: 35105034
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
 
LVL 20

Expert Comment

by:Sathish David Kumar N
ID: 35105115
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 9

Assisted Solution

by:ioanton
ioanton earned 664 total points
ID: 35106176
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
 
LVL 7

Author Comment

by:gudii9
ID: 35218461
>>>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
 
LVL 9

Expert Comment

by:ioanton
ID: 35225598
You can find here a more detailed description of the problem:

http://swik.net/itefforts/itefforts+blog/Understanding+%22inverse%22+mapping+attribute/bo772
0
 
LVL 7

Author Comment

by:gudii9
ID: 35369062
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
Suggested Courses

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question