Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » PrivateOwned dont work in Embeddable class
PrivateOwned dont work in Embeddable class [message #626910] Wed, 22 September 2010 18:11 Go to next message
Danilo Magrini is currently offline Danilo MagriniFriend
Messages: 4
Registered: September 2010
Junior Member
Hello, this is my first post in the forum. I have a problem with the annotation @ PrivateOwned with @ Embeddable. My classes:

@ Entity
public class A (
      @ Embedded
      B b;
)

@ Embeddable
public class B (
      @ OneToMany (mappedBy = "a", cascade = CascadeType.ALL)
      @ PrivateOwned
       List <C> lc;
)


The above example, at the time of deletion, the records of the table represented by the class "C" are not excluded and not disconnected. If I add the contents of class "B" directly in "A" works like a charm.

I tried to modify the mapping "OneToMany" to mappedBy = "b" but an error occurs.

Does anyone know tell me if the PrivatedOwned work with Embeddable or whether this is a bug. I'm using the eclipselink-2.1.1.v20100817-r8050 version.

thx a lot.
Re: PrivateOwned dont work in Embeddable class [message #628532 is a reply to message #626910] Thu, 23 September 2010 13:02 Go to previous messageGo to next message
Chris Delahunt is currently offline Chris DelahuntFriend
Messages: 1389
Registered: July 2009
Senior Member
Hello,

I don't see anything wrong with your mappings. The relationship from C needs to be to A since B does not have any identity. Private ownership is expected to work on any relationship field by causing the referenced entity to be deleted when the entity is dereferenced from the relationship.

Can you show the code you are having problems with and describe what you mean by add the contents of class "B" directly in "A"?

Best Regards,
Chris
Re: PrivateOwned dont work in Embeddable class [message #628602 is a reply to message #628532] Thu, 23 September 2010 13:21 Go to previous message
Danilo Magrini is currently offline Danilo MagriniFriend
Messages: 4
Registered: September 2010
Junior Member
Quote:

Can you show the code you are having problems with and describe what you mean by add the contents of class "B" directly in "A"?



thx for reply.

@Entity
public class A {

      @OneToMany (mappedBy="a",cascade=CascadeType.ALL)
      @PrivateOwned
       List <C> lc;

}


The above example works like a charm. Surprised
Previous Topic:EclipseLink Workbench source code?
Next Topic:How can I associate primary and secondary tables with a join criteria other than the compound key
Goto Forum:
  


Current Time: Thu Mar 28 19:02:54 GMT 2024

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

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

Back to the top