Menu

#880 SQL Designer Mode: Auto generate KeyRef from PK attribute

Elbert
closed
5
2015-01-15
2015-01-08
drrwebber
No

I am outputting this from the XSLT but the Java appears to only be expecting DBMapping and Definition annotations.

Need to add KeyRef as well.

<camed:annotation item="//PerAllPeopleFDetails/EffectiveEndDate">
     <camed:documentation type="KeyRef">EFFECTIVE_END_DATE</camed:documentation>
  </camed:annotation>
  <camed:annotation item="//PerAllPeopleFDetails/EffectiveStartDate">
     <camed:documentation type="KeyRef">EFFECTIVE_START_DATE</camed:documentation>
  </camed:annotation>
  <camed:annotation item="//PerAllPeopleFDetails/PersonId">
     <camed:documentation type="KeyRef">PERSON_ID</camed:documentation>
  </camed:annotation>
  <camed:annotation item="//PerAllPeopleFDetails/PersonId">
     <camed:documentation type="DBMapping">HR.PER_ALL_PEOPLE_F.PERSON_ID</camed:documentation>
  </camed:annotation>

Discussion

  • drrwebber

    drrwebber - 2015-01-08

    Now I see what is happening. When the CAM Editor saves the CAM template - it does this:

     <camed:annotation item="//PerAllPeopleFDetails/EffectiveStartDate">
      <camed:documentation type="KeyRef">EFFECTIVE_START_DATE</camed:documentation>
    </camed:annotation>
    <camed:annotation item="/PerAllPeopleFDetails/EffectiveStartDate">
      <camed:documentation type="DBMapping">HR.PER_ALL_PEOPLE_F.EFFECTIVE_START_DATE</camed:documentation>
    </camed:annotation>
    

    So when a KeyRef annotation occurs - then the item XPath has a leading / removed!

     <camed:annotation item="/PerAllPeopleFDetails/EffectiveStartDate">
    

    Not sure why this is happening - but the editor clearly is expecting this when it loads up the template.

     
  • drrwebber

    drrwebber - 2015-01-08

    OK - I added some annotations in the editor - definitely a bug in the Java - here is how it should be writing the annotations! I will fix my XSLT so it outputs from the SQL designer in this format too.

     <camed:annotation item="//PerAllPeopleFDetails/EffectiveStartDate">
      <camed:documentation type="KeyRef">EFFECTIVE_START_DATE</camed:documentation>
      <camed:documentation type="Definition">Here is some text</camed:documentation>
      <camed:documentation type="DBMapping">HR.PER_ALL_PEOPLE_F.EFFECTIVE_START_DATE</camed:documentation>
    </camed:annotation>
    
     
  • drrwebber

    drrwebber - 2015-01-15

    No changed needed to Java; XSLT changes resolves this.

     
  • drrwebber

    drrwebber - 2015-01-15
    • status: open --> closed
     

Log in to post a comment.