db-jdo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig Russell (JIRA)" <j...@apache.org>
Subject [jira] Commented: (JDO-615) MetaData specification API
Date Wed, 03 Dec 2008 18:23:44 GMT

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

Craig Russell commented on JDO-615:
-----------------------------------

> Maybe best to just skip the whole services thing for JDOMetaData. Just add the following
to the PMF (and JDOEnhancer) 
> 
> JDOMetadata newMetadata() 
> void registerMetadata(JDOMetadata)

Cool. 

When adding metadata to PMF and enhancer, what override rules do we want? That is, we need
to take a look at this part of Chapter 18:

 JDO 2.2 218 October 10, 2008 
When metadata information is needed for a class, and the metadata for that class has not already

been loaded, the metadata is searched for as follows: META-INF/package.jdo, WEB-INF/pack-

age.jdo, package.jdo, <package>/.../<package>/package.jdo, and <package>/<class>.jdo.
Once
metadata for a class has been loaded, the metadata will not be replaced in memory as long
as the 
class is not garbage collected. Therefore, metadata contained higher in the search order will
always 
be used instead of metadata contained lower in the search order. 

So where in this hierarchy does metadata added via calls (I assume that you can make many
calls to registerMetadata) go?



> MetaData specification API
> --------------------------
>
>                 Key: JDO-615
>                 URL: https://issues.apache.org/jira/browse/JDO-615
>             Project: JDO
>          Issue Type: New Feature
>            Reporter: Andy Jefferson
>             Fix For: JDO 2 maintenance release 3
>
>         Attachments: jdometadata-4.patch
>
>
> We can specify MetaData via XML or annotations. The only way missing is via an API. I
propose mirroring the XML structure with interfaces of the form
> public interface MetaData
> {
>     addExtension(String key, String value);
>     removeExtension(String key, String value);
>     ...
> }
> public interface FileMetaData
> {
>     addPackage(PackageMetaData pmd);
>     ...
> }
> public interface PackageMetaData
> {
>     addClass(ClassMetaData cmd)
>     ...
> }
> public interface ClassMetaData
> {
>     addField(FieldMetaData fmd)
>     ...
> }
> public interface FieldMetaData
> {
>     setInheritance(InheritanceMetaData inhmd)
>     ...
> }
> and so on.
> We would then require a method on the PMF to register the metadata.
> If there are no objections to such a feature I'll propose a patch to try to provide all
current JDO2 capabilities.

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


Mime
View raw message