[ https://issues.apache.org/jira/browse/JDO-615?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12651966#action_12651966 ]
Andy Jefferson commented on JDO-615: ------------------------------------ To demonstrate a typical use-case for this API, have a look at this :- http://www.jpox.org/servlet/wiki/pages/viewpage.action?pageId=6619188 This demonstrates the dynamic generation of a class in memory. We then create MetaData for it (DataNucleus API in this case). We then enhance the in-memory class. We finally use the in-memory enhanced class (and metadata) at runtime. JDO-591 will standardise the enhancer API, and JDO-615 will standardise the MetaData API, hence going a long way towards providing the full process without touching a particular vendors classes. > 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-3.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.