Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] Question on @PRivateOwned

The @PrivateOwned annotation is EclipseLink specific.  EclipseLink also
supports the same extension to the JPA orm.xml in the eclipselink-orm.xml. 
The XML element is <private-owned>

See,
http://wiki.eclipse.org/EclipseLink/XSDs#JPA

EclipseLink does support combining annotations and XML, but if you override
a mapping in XML you must override the entire mapping.  So if you give any
XML for an attribute it overrides the annotations.



Maky2507 wrote:
> 
> Hi,
> In my applocation, I am using XML to hold metadata information for all the
> persistent entities. Now I see a scenarion where I have to use annotation.
> The scenario is I have an Entity A, that holds a collection of entity B.
> Whenever I remove an entity B from the list, I want the entoty B to be
> removed from the Database also. I got to know that @PrivateOwned is the
> way. However I could not find XML equivalent of @PrivateOwned annotation.
> So when I map that list property in entity A as @PrivateOwned (I removed
> xml one-to-many mapping for this property), I get Entity Manager creations
> failure.
> So I have couple of questions
> 1. Is there any xml equivalent of @PrivareOwned annotation?
> 2. Whie using both annotation and XML way of defining metadata, can we
> just use annotation for one property of an entity or should we use
> annotation for all the properties of the enitity? [Please see I am not
> using metadata-complete=true here]
> 3. Any idea on why I am getting "java.lang.IllegalStateException:
> EntityManagerFactory has not been created for PU:" exception.
> 
> Please help me out, I stuck in this problem for a week now.
> Thanks inadvance,
> Maky
> 


-----
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://old.nabble.com/Question-on-%40PRivateOwned-tp28364407p28380029.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.



Back to the top