what is the difference between owned one to many relationship and owned one to many bidirectional relationship i read the article below but i don't understand it. Article
views:
34answers:
2
                +1 
                A: 
                
                
              The owned one to many bidirectional relationship just means that the children have a reference to the parent. For example, the child below can access the parent via persistentUser. If persistentUser didn't exist in the PersistentLogin class then it would not be bidirectional.
One-to-Many (PersistentUser.java - Parent):
@OneToMany(mappedBy = "persistentUser", cascade = CascadeType.ALL)
private Collection<PersistentLogin> persistentLogins;
Many-to-One (PersistentLogin.java - Child):
@ManyToOne(fetch = FetchType.LAZY)
private PersistentUser persistentUser;
                  Taylor Leese
                   2010-06-06 05:24:35
                
              Hi taylor thanks for the reply.I'm new to GAE so i may understand it a little hard.Now guess there is a FootballTeam.java class and a Player.java class.A Football team have many Players.Now what happens if i do this relationship bidirectional ?
                  Kerem Pekçabuk
                   2010-06-07 20:55:56
                That relationship would be represented the same way as the example I gave. The @OneToMany relationship would be on the FootballTeam class with a Collection<Player> players attribute. The @ManyToOne relationship would be in the Player class with a FootballTeam team attribute.
                  Taylor Leese
                   2010-06-08 00:38:21
                Taylor i understood that but i think i don't know the meaning of the word bidirectional in relationships.What happens if the relation becomes bidirectional ? could you please give me an example about football team class and player class ? Thanks
                  Kerem Pekçabuk
                   2010-06-08 20:46:52
                The term bidirectional just means that the player has a reference to the team. If this relationship does not exist on the player then it is not bidirectional. Rather, it would be a unidirectional relationship.
                  Taylor Leese
                   2010-06-08 21:47:54
                An owned one to many relationship means that every record must have a referance.For example every player must have a team.It looks like the same thing in your answer.i couldn't understand the difference between an owned relationship and bidirectional relationship.
                  Kerem Pekçabuk
                   2010-06-10 20:56:51
                
                
                A: 
                
                
              
            Finally i understand it.Guess i have a Class Named FootBallTeam and it has a property named teamname. Now the pseudue code is
   FootBallTeam ft = new FootBallTeam();
    ft.setteamname("Barcelona");
then add 3 Player Class entity under this team named Messi,Xavi,Iniesta. now if the relationship is bidirectional when i run the code below,
   ft.setteamname("Real Madrid");
it automatically runs the below codes behind the scenes.
Messi.setteamname("Real Madrid")
Xavi.setteamname("Real Madrid")
Iniesta.setteamname("Real Madrid")
                  Kerem Pekçabuk
                   2010-06-11 19:58:02