> What I've found is that by adding a file SimpleObject.jdo (in the
> domainapp/dom/simple package, right alongside SimpleObject.java), with the
> contents:
> 
> <?xml version="1.0" encoding="UTF-8" ?>
> <jdo xmlns="http://xmlns.jcp.org/xml/ns/jdo/jdo";
>      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>      xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/jdo/jdo
>         http://xmlns.jcp.org/xml/ns/jdo/jdo_3_0.xsd";>
> 
>     <package name="domainapp.dom.simple">
>         <class name="SimpleObject"
>                schema="simpleXX">
>         </class>
>     </package>
> </jdo>
> 
> then this was enough to change the schema.  (If you try to repeat this
> test, note that the SimpleObjectTeardown fixture also needs to be changed
> to reference the different schema).
> 
> When I went to download the JDO metadata before-and-after the change (on
> the metadata panel), the only difference is this change in schema.
> 
> So, it looks like DataNucleus will merge any XML metadata with any
> annotations (with the XML metadata taking preference).  In other words,
> exactly what we want.  (Andy, if you pick this up, any
> comments/corrections?)

JDO standard metadata mechanism is as you describe, see

http://www.datanucleus.org/products/accessplatform_5_0/jdo/metadata.html

which gives order or priority of the different metadata input types. The 
merging process is not perfect but tries to handle all common situations.


Regards
-- 
Andy
DataNucleus (Web: http://www.datanucleus.org   Twitter: @datanucleus)

Reply via email to