You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jdo-dev@db.apache.org by "Marco (JIRA)" <ji...@apache.org> on 2010/10/25 21:02:19 UTC

[jira] Created: (JDO-668) Extend PersistenceManageFactory to find a Class

Extend PersistenceManageFactory to find a Class
-----------------------------------------------

                 Key: JDO-668
                 URL: https://issues.apache.org/jira/browse/JDO-668
             Project: JDO
          Issue Type: New Feature
            Reporter: Marco


The meta-data-related methods in PersistenceManagerFactory work with Strings (fully qualified class-names) instead of classes. This includes the new method requested in JDO-667.

However, to actually do sth. (e.g. create a new query or get an extent), a java.lang.Class is required. In some environments (e.g. OSGi), class-loading is not trivial and it is therefore not so easy to get the right java.lang.Class (i.e. the same as used by the JDO implementation) for a certain class-name.

Since the JDO implementation needs to be able to load the right classes, anyway, the class-loading must already be solved somehow (e.g. by an OSGi-aware class-loader). It should therefore be easy to expose the method used by the JDO implementation for class-loading.

For these reasons, I kindly request the following new method in PersistenceManagerFactory:

Class<?> getManagedClass(String className)

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


[jira] Updated: (JDO-668) Extend PersistenceManageFactory to find a Class

Posted by "Michael Bouschen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JDO-668?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael Bouschen updated JDO-668:
---------------------------------

          Component/s: tck
                       specification
                       api
    Affects Version/s: JDO 3

> Extend PersistenceManageFactory to find a Class
> -----------------------------------------------
>
>                 Key: JDO-668
>                 URL: https://issues.apache.org/jira/browse/JDO-668
>             Project: JDO
>          Issue Type: New Feature
>          Components: api, specification, tck
>    Affects Versions: JDO 3
>            Reporter: Marco
>
> The meta-data-related methods in PersistenceManagerFactory work with Strings (fully qualified class-names) instead of classes. This includes the new method requested in JDO-667.
> However, to actually do sth. (e.g. create a new query or get an extent), a java.lang.Class is required. In some environments (e.g. OSGi), class-loading is not trivial and it is therefore not so easy to get the right java.lang.Class (i.e. the same as used by the JDO implementation) for a certain class-name.
> Since the JDO implementation needs to be able to load the right classes, anyway, the class-loading must already be solved somehow (e.g. by an OSGi-aware class-loader). It should therefore be easy to expose the method used by the JDO implementation for class-loading.
> For these reasons, I kindly request the following new method in PersistenceManagerFactory:
> Class<?> getManagedClass(String className)

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


[jira] Commented: (JDO-668) Extend PersistenceManageFactory to find a Class

Posted by "Craig L Russell (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JDO-668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12926357#action_12926357 ] 

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

You are right that it is not straightforward to resolve a class name to a class instance. As you point out, OSGi can dynamically add and remove class loaders. The application itself can dynamically add and remove class loaders. 

JDO has always been organized such that it is up to the application to arrange for classes to be loaded and then the classes or instances of classes are passed to the implementation. 

I think it is still appropriate for JDO to require that the application arrange for class loading. So I recommend we reject this feature request.

> Extend PersistenceManageFactory to find a Class
> -----------------------------------------------
>
>                 Key: JDO-668
>                 URL: https://issues.apache.org/jira/browse/JDO-668
>             Project: JDO
>          Issue Type: New Feature
>          Components: api, specification, tck
>    Affects Versions: JDO 3
>            Reporter: Marco
>
> The meta-data-related methods in PersistenceManagerFactory work with Strings (fully qualified class-names) instead of classes. This includes the new method requested in JDO-667.
> However, to actually do sth. (e.g. create a new query or get an extent), a java.lang.Class is required. In some environments (e.g. OSGi), class-loading is not trivial and it is therefore not so easy to get the right java.lang.Class (i.e. the same as used by the JDO implementation) for a certain class-name.
> Since the JDO implementation needs to be able to load the right classes, anyway, the class-loading must already be solved somehow (e.g. by an OSGi-aware class-loader). It should therefore be easy to expose the method used by the JDO implementation for class-loading.
> For these reasons, I kindly request the following new method in PersistenceManagerFactory:
> Class<?> getManagedClass(String className)

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