Understanding Link-entity in FetchXML

廉价感情. 提交于 2019-12-29 07:18:12

问题


I understand <link-entity> is used to do joins, but can you help me translate the following into english?

<entity name = "example">

*insert a bunch of attributes*

     <link-entity name="providercertification" from="providerid" to="vendorid" alias="aa">

I understand <link-entity> is used for joins, but the join type is not specified, so that is throwing me off. How does the link-entity work if no join type is specified? Is it automatically an inner join?

Also, which column does the from part apply to? The very first entity or the one specified in the <link-entity>?

Same question for the from part.


回答1:


Per documentation the below query is totally valid, which means alias, from & link-type are optional.

from always refer to same entity as link-entity node (primary key systemuserid of systemuser in this case). to refers to attribute of entity parent node (owninguser of account in this case)

   <entity name='account'>   
      <attribute name='accountid'/>   
      <attribute name='name'/>   
      <link-entity name='systemuser' to='owninguser'>   

Use a left outer join in FetchXML to query for records "not in"

So explicit link-type='outer' is required for outer join but inner join is default.

Interestingly Fetchxml is full of surprises. You can also refer FetchXML schema



来源:https://stackoverflow.com/questions/53216249/understanding-link-entity-in-fetchxml

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!