Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 361296 - Enhancement: Support @XmlInverseReference where both directions use the same property
Summary: Enhancement: Support @XmlInverseReference where both directions use the same...
Status: NEW
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 enhancement with 2 votes (vote)
Target Milestone: ---   Edit
Assignee: Nobody - feel free to take it CLA
QA Contact:
URL: http://stackoverflow.com/questions/78...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-18 15:02 EDT by Blaise Doughan CLA
Modified: 2022-06-09 10:27 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Blaise Doughan CLA 2011-10-18 15:02:20 EDT
Currently MOXy supports @XmlInverseReference using two different properties, one for the containment relationship, and the second for the backpointer.  This enhancement is to support the case where there is only one property.

Below is an example.  Two instances of person reference each other through the spouse property.

  public class Person {
 
     private Person spouse;

     @XmlInverseReference(mappedBy="spouse")
     public Person getSpouse() {
        return spouse;
     }

     public Person setSpouse(Person spouse) {
        this.spouse = spouse;
     }

   }
Comment 1 Saravanan Subiramaniam CLA 2013-06-09 11:28:56 EDT
Hi Blaise,
   I've the following entity:

public class Relationship {
 
     private Relationship reverseRelationship;

     @XmlInverseReference(mappedBy="reverseRelationship")
     public Relationship getReverseRelationship() {
        return reverseRelationship;
     }

     public Relationship setReverseRelationship(Relationship reverseRelationship) {
        this.reverseRelationship = reverseRelationship;
     }

}

and my requirement is that both Relationship and reverseRelationship can be two different instances or the same instance. Will this also be handled (i.e. @XmlInverseReference where both directions use the same property and use the same instance)?
Comment 2 Eclipse Webmaster CLA 2022-06-09 10:27:54 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink