Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » Problem when try to use @XmlInverseReference where reference is on abstract class(Problem when try to use @XmlInverseReference where reference is on abstract class, and we have many collection of concrete classes)
Problem when try to use @XmlInverseReference where reference is on abstract class [message #1729566] Fri, 15 April 2016 14:12
Clovis Wichoski is currently offline Clovis WichoskiFriend
Messages: 11
Registered: January 2016
Junior Member
Hi,

There is a way to achieve this type of object structure works with Moxy?
Today I cant achieve this because I can only add one XmlInverseReference

@Entity
@Inheritance(strategy = InheritanceType.JOINED)
abstract class A {
  @XmlInverseReference(mappedBy = "b")
  @XmlInverseReference(mappedBy = "c") //ERROR
  @ManyToOne
  D d;
}

@Entity
@XmlDiscriminatorValue("B")
@DiscriminatorValue("B")
class B extends A {
  //...
}

@Entity
@XmlDiscriminatorValue("C")
@DiscriminatorValue("C")
class C extends A {
  //...
}

class D {
    @OneToMany(fetch = FetchType.EAGER, cascade = ALL, orphanRemoval = true, mappedBy = "d")
    List<B> b;

    @OneToMany(fetch = FetchType.EAGER, cascade = ALL, orphanRemoval = true, mappedBy = "d")
    List<C> c;
}


[Updated on: Fri, 15 April 2016 14:14]

Report message to a moderator

Previous Topic:java.lang.NullPointerException: when OrderedListContainerPolicy.updateChangeRecordForSelfMerge(...)
Next Topic:Query Results Cache with OneToMany and "Fetch Join"
Goto Forum:
  


Current Time: Thu Apr 25 13:06:42 GMT 2024

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

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

Back to the top