jdo tag <order>
---------------

         Key: XDT-1606
         URL: http://opensource.atlassian.com/projects/xdoclet/browse/XDT-1606
     Project: XDoclet
        Type: Improvement

  Components: JDO Module  
    Versions: 1.2.3    
 Environment: W2K, JDK5, Ant 1.6.5
    Reporter: André Fügenschuh
 Assigned to: xdoclet-devel (Use for new issues) 


For 1-N relations on an existing database I need a jdo tag "@jdo.order" with 
attribute "mapped-by" generating an element <order> under <field>  like the 
following:

    <class name="Foo"
            identity-type="application"
            detachable="true"> 
         <inheritance strategy="new-table"></inheritance>
        <field ...></field>
        <field name="details"
               persistence-modifier="persistent"
               null-value="default"> 
          <collection element-type="tld.domain.pkg.Detail"></collection>
          <element column="DetailID"></element>
          <order mapped-by="id"></order>
        </field>
      <fetch-group name="fgDetails">
         <field name="details"/>
      </fetch-group>
     </class>

Workaround: I (mis)used the "jdo_xml.package_class_field_element.xdt" to 
integrate it, so following that template's syntax I guess that I will be not 
much work to include a new "XDtConfig" in "jdo_xml.package_class_field.xdt" 
like:

               <XDtConfig:ifConfigParamEquals paramName="jdospec" value="2.0">
          <XDtField:ifHasFieldTag tagName="jdo.element">
           <XDtMerge:merge 
file="xdoclet/modules/jdo/resources/jdo_xml.package_class_field_order.xdt">
           </XDtMerge:merge>
                </XDtField:ifHasFieldTag>
               </XDtConfig:ifConfigParamEquals>

and a "jdo_xml.package_class_field_order.xdt" like:

          <order
            <XDtField:ifHasFieldTag tagName="jdo.order" paramName="column">
                    column="<XDtField:fieldTagValue tagName="jdo.order" 
paramName="column"/>"
            </XDtField:ifHasFieldTag>
            <XDtField:ifHasFieldTag tagName="jdo.order" paramName="mapped-by">
                    mapped-by="<XDtField:fieldTagValue tagName="jdo.order" 
paramName="mapped-by"/>"
            </XDtField:ifHasFieldTag>
          > <XDtComment:comment> end tag *order* </XDtComment:comment>
          </order>

(See: http://www.jpox.org/docs/1_1/metadata_reference.html#order for details)

BTW: What about two "merge points" in "jdo_xml.xdt" (for the class element) and 
"jdo_xml.package_class_field_element.xdt" (for the field element) to get entry 
points for "user" adaptations?

As long as many parts of the jdo2 spec are not yet (and maybe will never be) 
supported (see: XDT-1140), this could be a (interim) solution.


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://opensource.atlassian.com/projects/xdoclet/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid3432&bid#0486&dat1642
_______________________________________________
xdoclet-devel mailing list
xdoclet-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/xdoclet-devel

Reply via email to