[ 
https://issues.apache.org/jira/browse/JDO-667?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12926362#action_12926362
 ] 

Craig L Russell commented on JDO-667:
-------------------------------------

Given that the JDO implementation keeps track of persistence-capable and 
persistence-aware classes, it makes sense for the application to get the 
collection of such classes.

And given that it's awkward for the application itself to manage the 
name-to-class mapping, it also makes sense for the return type of the 
PersistenceManagerFactory getManagedClasses() method to be 
Collection<java.lang.Class<?>>.

As far as the requirements for what classes are returned, I'd say it should be 
pretty loose. I agree with you that the result must include all classes that 
have been referenced by all PMs obtained from the PMF. Referenced would be 
those as parameters in getExtent(...), newQuery(...), makePersistent(...). 

I'd also add that the result may include other classes that the implementation 
has loaded based on implementation policy or non-standard features.

> Extend PersistenceManageFactory to return all known entity classes
> ------------------------------------------------------------------
>
>                 Key: JDO-667
>                 URL: https://issues.apache.org/jira/browse/JDO-667
>             Project: JDO
>          Issue Type: New Feature
>    Affects Versions: JDO 3
>            Reporter: Marco
>             Fix For: JDO 3 maintenance release 1
>
>
> JDO 3 now has the ability to declare meta-data programmatically. Part of this 
> feature is the ability to ask the PersistenceManagerFactory via the method 
> getMetadata(java.lang.String) for the meta-data of one single class. But 
> there is no way to list all known classes.
> I therefore kindly ask for a new method in PersistenceManagerFactory like 
> this:
> Collection<String> getClassesWithMetadata();
> Btw., this is Andy's suggestion posted here: 
> http://www.datanucleus.org/servlet/forum/viewthread_thread,6379#33224
> I'd greatly appreciate, if this method became a part of JDO 3.1.
> Edit 1: I just saw the various overloaded methods getManagedObjects(...) in 
> PersistenceManager - maybe the alternative method name "getManagedClasses()" 
> would be more consistent?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to