[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [eclipselink-users] Problems with @PrivateOwned annotation : "Ignoring @PrivateOwned on element ..."
|
This seems to be a bug, please log this in Bugzilla. I think the code is
currently not allowing @PrivateOwned on a @OneToMany that uses a join table,
this is wrong. The error message is odd as well, @PrivateOwned makes no
sense on a @BasicCollection or @BasicMap (it is implied).
You are correct, private owned means if you remove an element it will be
deleted. It means the parent owns the child object(s) and allows you to
only have to worry about the parent object.
As a workaround you can set the private owned directly on the mapping using
a DescriptorCustomizer.
fedr wrote:
>
> Hi,
> i have an Entity with a method like :
>
> @OneToMany(cascade = CascadeType.ALL)
> @org.eclipse.persistence.annotations.PrivateOwned
> public List getList() {
> return list;
> }
>
> but the @PrivateOwned annotation is ignored, i get this message:
>
> [EL Warning]: 2008.05.11
> 17:03:02.195--ServerSession(6662015)--Thread(Thread[main,5,main])--Ignoring
> @PrivateOwned on element [public java.util.List
> eclipselinktest.B.getList()] within entity class [class
> eclipselinktest.B]. A @PrivateOwned can only be used with a
> @BasicCollection, @BasicMap, @OneToOne and @OneToMany.
>
> this is a @OneToMany, why it ignores the @PrivateOwned annotation ?
>
> Or this is the not right way to use it ?
>
> Just to understand if i mark it with @PrivateOwned, when i
> remove/clear elements from the list then the elements will be removed
> from the database too, right?
>
> Bye
> Thanks for the help
>
-----
---
http://wiki.eclipse.org/User:James.sutherland.oracle.com James Sutherland
http://www.eclipse.org/eclipselink/
EclipseLink , http://www.oracle.com/technology/products/ias/toplink/
TopLink
Wiki: http://wiki.eclipse.org/EclipseLink EclipseLink ,
http://wiki.oracle.com/page/TopLink TopLink
Forums: http://forums.oracle.com/forums/forum.jspa?forumID=48 TopLink ,
http://www.nabble.com/EclipseLink-f26430.html EclipseLink
Book: http://en.wikibooks.org/wiki/Java_Persistence Java Persistence
--
View this message in context: http://www.nabble.com/Problems-with-%40PrivateOwned-annotation-%3A-%22Ignoring-%40PrivateOwned-on-element-...%22-tp17174381p17187108.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.