Skip to main content



      Home
Home » Eclipse Projects » EclipseLink » PrivateOwned dont work in Embeddable class
PrivateOwned dont work in Embeddable class [message #626910] Wed, 22 September 2010 14:11 Go to next message
Eclipse UserFriend
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 09:02 Go to previous messageGo to next message
Eclipse UserFriend
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 09:21 Go to previous message
Eclipse UserFriend
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 Jul 03 20:30:19 EDT 2025

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

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

Back to the top