Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » right way to maintain bi-directional relationships
right way to maintain bi-directional relationships [message #1748941] Wed, 30 November 2016 09:56 Go to next message
stefano grima is currently offline stefano grimaFriend
Messages: 2
Registered: August 2015
Junior Member
Hi Team,

I need to know how to maintain bidirectional manyToOne and OneToOne in the right way , beacause i have some problem while delete or update entities
in my application .

Environment

Payara Version: 4.1.1.163
- Edition: Full
- JDK Version: 8 - Oracle
- Operating System: Linux

Framework
- jsf + primefaces
- eclipselink
Re: right way to maintain bi-directional relationships [message #1749092 is a reply to message #1748941] Thu, 01 December 2016 18:07 Go to previous messageGo to next message
Chris Delahunt is currently offline Chris DelahuntFriend
Messages: 1272
Registered: July 2009
Senior Member
Not sure I understand. When you make a change to one side, you must make the corresponding change to the other side and ensure both changes are picked up by the context -either by modifying managed entities or merging both changed detached instances back into the context. What exactly are you doing?
Re: right way to maintain bi-directional relationships [message #1749401 is a reply to message #1748941] Tue, 06 December 2016 09:49 Go to previous message
stefano grima is currently offline stefano grimaFriend
Messages: 2
Registered: August 2015
Junior Member
My question is : what is the best solution to maintain the relation ?
In my applications the users can change the associations through the interaction with the view (JSF framework) . I ensure the relation's maintenance
in the stateless EJB responsible for the management of transactions in the persistence context .
The hardest part is the update method because i change the state of three entities for each change of association :
1 - The relation owner entity
2 - The old inverse entity ( remove operation on the oneToMany list )
3 - The new inverse entity ( add operation on the oneToMany list )





Previous Topic:Documentation for eclipselink.transaction.join-existing property?
Next Topic:ConcurrencyException throwed [SOLVED]
Goto Forum:
  


Current Time: Mon Nov 20 17:35:05 GMT 2017

Powered by FUDForum. Page generated in 0.01747 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software