facebook

SunOne8 CompositeKey CMR XDoclet issue

  1. MyEclipse IDE
  2.  > 
  3. General Development
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #211784 Reply

    markprice
    Member

    – System Setup ——————————-
    Operating System and version: Suse Linux v8
    Eclipse version: 3.0
    Eclipse build id: 200406251208
    Fresh Eclipse install (y/n): n
    If not, was it upgraded to its current version using the update manager? n
    Other installed external plugins: 0
    Number of plugins in the <eclipse>/plugins directory that begin with org.eclipse.pde.*: 8 (inc pde_3.0.0)
    MyEclipse version: 3.7.200
    Eclipse JDK version: 1.4.2_02-b03
    Application Server JDK version: 1.4.2_02-b03
    Are there any exceptions in the Eclipse log file? none related

    – Message Body ——————————-

    When specifying relationships using @sunone.relation, how can I specify a column name if the Pkey for that table is a custom PK?
    And is it necessary to specify relationships using the @sunone tags, if they have already been fully defined with @ejb.relation? Thanks

    #211791 Reply

    Riyad Kalla
    Member

    Mark,
    I’ve asked our Xdoclet guy to have a look at this.

    #211843 Reply

    markprice
    Member

    I’ve tried adding in the sunone.relation tags as below:

    ## code removed ##

    EJBs are generated fine, and all seems to be OK, apart from the fact that there are no <cmr-field-mapping> elements generated in the sun-cmp-settings.xml file. The generated file [section] is below:

    ## code removed ##
    ===============================

    Below is a section of sun-cmp-mapping.xml as generated by SunOne8 DeployTool (correct CMR mappings are present):

    ## code removed ##

    #211902 Reply

    Greg
    Member

    Just as a quick glance it seems that the @sunone.relation tags don’t need to be on the TrackingURL primary key but rather on the CMR fields that define relationships with the three other beans. According to the correct xml file you are trying to define CMR relationships with three other beans: trackingEntity, urlEntity, and trackingActionsEntity. So in this entity beans source whatever CMR fields you are using to represent these relationships is where you need to specify the @sunone.relation tags instead of defining them in the TrackingURL’s primary key.

    This is just at quick glance, if I am way off, please post the full source to all the beans in question that are in this CMR relationship so we can try to better understand your problem. Thanks.

    #211933 Reply

    markprice
    Member

    I’ve been instructed not to post source code to a public forum 🙁
    I tried defining the relationships in the other beans, but it seemed to have no effect. I’m clutching at straws here, but could this problem have anything to do with the (historic) bug:
    http://opensource.atlassian.com/projects/xdoclet/secure/ViewIssue.jspa?key=XDT-16
    It just seems to be the same issue, but the post is so old, I assume that this has now been fixed…

    #211938 Reply

    markprice
    Member

    I’ve just found this post, related to the above, and will try it out & post the results:
    http://opensource.atlassian.com/projects/xdoclet/browse/XDT-537

    #211975 Reply

    markprice
    Member

    In the sunone module for XDoclet1.2.1 [xdoclet-sun-module-1.2.1.jar] in dir
    MyEclipse_beta2/eclipse/plugins/com.genuitec.jboss.ide.eclipse.xdoclet.core_3.7.200
    Replace contents of file sun-smp-mappings_xml.xdt with the following & re-archive:

    <?xml version=”1.0″ encoding=”<XDtConfig:configParameterValue paramName=”Xmlencoding”/>”?>
    <!DOCTYPE sun-cmp-mappings PUBLIC “<XDtXml:publicId/>” “<XDtXml:systemId/>”>

    <!– <XDtI18n:getString resource=”generated_by_xdoclet”/> –>

    <sun-cmp-mappings>
    <XDtComment:comment>
    * In theory, the file could contain a number of mappings, to different schemas.
    * For now, we’ll just assume there’s only one.
    </XDtComment:comment>
    <sun-cmp-mapping>
    <schema><XDtConfig:configParameterValue paramName=”CmpSchema”/></schema>
    <XDtEjb:forAllBeans>
    <XDtEjb:ifIsAConcreteEJBean>
    <XDtEjbEntity:ifEntity>
    <XDtEjbCmp:ifEntityIsCmp>
    <entity-mapping>
    <ejb-name><XDtEjb:ejbName/></ejb-name>
    <table-name><XDtClass:classTagValue tagName=”ejb.persistence” paramName=”table-name”/></table-name>
    <XDtEjbCmp:forAllCmpFields>
    <cmp-field-mapping>
    <field-name><XDtMethod:propertyName/></field-name>
    <column-name><XDtMethod:methodTagValue tagName=”ejb.persistence” paramName=”column-name”/></column-name>
    <XDtMethod:ifMethodTagValueEquals tagName=”ejb.persistence” paramName=”read-only” value=”true”>
    <read-only/>
    </XDtMethod:ifMethodTagValueEquals>
    <XDtMethod:ifHasMethodTag tagName=”sunone.fetched-with”>
    <fetched-with>
    <XDtMethod:ifHasMethodTag tagName=”sunone.fetched-with” paramName=”level”>
    <level><XDtMethod:methodTagValue tagName=”sunone.fetched-with” paramName=”level”/></level>
    </XDtMethod:ifHasMethodTag>
    <XDtMethod:ifHasMethodTag tagName=”sunone.fetched-with” paramName=”named-group”>
    <named-group><XDtMethod:methodTagValue tagName=”sunone.fetched-with” paramName=”named-group”/></named-group>
    </XDtMethod:ifHasMethodTag>
    <XDtMethod:ifMethodTagValueEquals tagName=”sunone.fetched-with” paramName=”none” value=”true”>
    <none/>
    </XDtMethod:ifMethodTagValueEquals>
    </fetched-with>
    </XDtMethod:ifHasMethodTag>
    </cmp-field-mapping>
    </XDtEjbCmp:forAllCmpFields>
    <XDtComment:comment>
    * start change – MP
    </XDtComment:comment>
    <XDtMethod:forAllMethods>
    <XDtMethod:ifHasMethodTag tagName=”sunone.relation”>

    <cmr-field-mapping>
    <cmr-field-name><XDtMethod:propertyName/></cmr-field-name>

    <XDtMethod:forAllMethodTags tagName=”sunone.relation”>
    <column-pair>
    <column-name><XDtMethod:methodTagValue tagName=”sunone.relation” paramName=”column”/></column-name>
    <column-name><XDtMethod:methodTagValue tagName=”sunone.relation” paramName=”target”/></column-name>
    </column-pair>
    </XDtMethod:forAllMethodTags>
    <XDtMethod:ifHasMethodTag tagName=”sunone.fetched-with”>
    <fetched-with>
    <XDtMethod:ifHasMethodTag tagName=”sunone.fetched-with” paramName=”level”>
    <level><XDtMethod:methodTagValue tagName=”sunone.fetched-with” paramName=”level”/></level>
    </XDtMethod:ifHasMethodTag>
    <XDtMethod:ifHasMethodTag tagName=”sunone.fetched-with” paramName=”named-group”>
    <named-group><XDtMethod:methodTagValue tagName=”sunone.fetched-with” paramName=”named-group”/></named-group>
    </XDtMethod:ifHasMethodTag>
    <XDtMethod:ifMethodTagValueEquals tagName=”sunone.fetched-with” paramName=”none” value=”true”>
    <none/>
    </XDtMethod:ifMethodTagValueEquals>
    </fetched-with>
    </XDtMethod:ifHasMethodTag>
    </cmr-field-mapping>
    </XDtMethod:ifHasMethodTag>
    </XDtMethod:forAllMethods>
    <XDtComment:comment>
    * end change – MP
    </XDtComment:comment>

    <XDtComment:comment>
    * The secondary-table element is not currently supported
    </XDtComment:comment>
    <XDtClass:ifHasClassTag tagName=”sunone.consistency”>
    <consistency>
    <XDtClass:ifClassTagValueEquals tagName=”sunone.consistency” paramName=”none” value=”true”>
    <none/>
    </XDtClass:ifClassTagValueEquals>
    <XDtClass:ifClassTagValueEquals tagName=”sunone.consistency” paramName=”check-modified-at-commit” value=”true”>
    <check-modified-at-commit/>
    </XDtClass:ifClassTagValueEquals>
    <XDtClass:ifClassTagValueEquals tagName=”sunone.consistency” paramName=”lock-when-loaded” value=”true”>
    <lock-when-loaded/>
    </XDtClass:ifClassTagValueEquals>
    <XDtComment:comment>
    * the order of these last two is significant, as they may be used together (the only ones which can)
    </XDtComment:comment>
    <XDtClass:ifClassTagValueEquals tagName=”sunone.consistency” paramName=”lock-when-modified” value=”true”>
    <lock-when-modified/>
    </XDtClass:ifClassTagValueEquals>
    <XDtClass:ifClassTagValueEquals tagName=”sunone.consistency” paramName=”check-all-at-commit” value=”true”>
    <check-all-at-commit/>
    </XDtClass:ifClassTagValueEquals>
    </consistency>
    </XDtClass:ifHasClassTag>
    </entity-mapping>
    </XDtEjbCmp:ifEntityIsCmp>
    </XDtEjbEntity:ifEntity>
    </XDtEjb:ifIsAConcreteEJBean>
    </XDtEjb:forAllBeans>
    </sun-cmp-mapping>
    </sun-cmp-mappings>

    This fix worked for me, and I now get valid <cmr-field-mapping> elements in sun-cmp-mappings.xml

    #211976 Reply

    markprice
    Member

    going back to the original question, how can I specify @sunone.relation between entities with a custom (composite) primary key? Thanks

Viewing 8 posts - 1 through 8 (of 8 total)
Reply To: SunOne8 CompositeKey CMR XDoclet issue

You must be logged in to post in the forum log in