<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="http://syndication.webwiz.co.uk/rss_namespace/">
 <channel>
  <title>DevForce Community Forum : Tech Tip: Span Queries</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce Classic : Tech Tip: Span Queries</description>
  <pubDate>Fri, 12 Jun 2026 11:29:41 -700</pubDate>
  <lastBuildDate>Wed, 06 Jun 2007 11:37:08 -700</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 9.69</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>www.ideablade.com/forum/RSS_post_feed.asp?TID=37</WebWizForums:feedURL>
  <image>
   <title>DevForce Community Forum</title>
   <url>http://www.ideablade.com/forum/forum_images/IdeaBlade_logo_tm.png</url>
   <link>http://www.ideablade.com/forum/</link>
  </image>
  <item>
   <title>Tech Tip: Span Queries : Level 200DevForce Express April...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=37&amp;PID=97#97</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=21" rel="nofollow">IdeaBlade</a><br /><strong>Subject:</strong> 37<br /><strong>Posted:</strong> 06-Jun-2007 at 11:37am<br /><br /><P =Questi&#111;n style="MARGIN: 0in 0in 0pt"><FONT face="Times New Roman" size=3><strong><EM>Level 200<BR>DevForce Express</EM></strong></FONT></P><P =Questi&#111;n style="MARGIN: 0in 0in 0pt"><strong><EM><FONT face="Times New Roman" size=3>April 18, 2006</FONT></EM></strong></P><P =Ms&#111;normal style="MARGIN: 8pt 0in 0pt"><FONT size=2><FONT face="Times New Roman">Sometimes you want more than just the business objects that match your search criteria; you want their related business objects as well. You want a "span" query. <SPAN style="mso-bidi-font-size: 9.0pt"><?:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN></FONT></FONT></P><P =Ms&#111;normal style="MARGIN: 8pt 0in 0pt"><SPAN style="mso-bidi-font-size: 9.0pt"><FONT size=2><FONT face="Times New Roman">A span query is a regular query with attached requests for related objects. Every query returns a primary object type. In a span query, we add "span" requests for objects that are linked to the primary object type by one (or more) mapped "relations".<o:p></o:p></FONT></FONT></SPAN></P><P =Ms&#111;normal style="MARGIN: 8pt 0in 0pt"><SPAN style="mso-bidi-font-size: 9.0pt"><FONT face="Times New Roman" size=2>In the query shown below, we retrieve all Orders placed within the last 7 days. We also want the Customers who placed these orders, their OrderDetails, and the Products purchased in those OrderDetails. Accordingly we add two spans, one reaching "upward" from Order to Customer and another reaching "downward", first to OrderDetail then and from OrderDetail to Product.</FONT></SPAN><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Helvetica">&nbsp;</SPAN><SPAN style="mso-bidi-font-size: 9.0pt"><o:p></o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 5pt 0in; LINE-HEIGHT: 13pt"><B><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Helvetica">C#:</SPAN></B><FONT size=2><SPAN style="FONT-FAMILY: Verdana; mso-bidi-font-size: 10.0pt"> </SPAN><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Helvetica"><o:p></o:p></SPAN></FONT></P><P =CodeSnippet style="MARGIN: 0in 0in 0pt 0.25in"><FONT style=": #e6e6e6" face="Courier New" color=#808080 size=2><strong>RdbQuery query1 = new RdbQuery(typeof(Order),</strong></FONT></P><P =CodeSnippet style="MARGIN: 0in 0in 0pt 0.25in"><FONT style=": #e6e6e6" face="Courier New" color=#808080 size=2><strong>&nbsp;&nbsp;Order.OrderDateEntityColumn, EntityQueryOp.GT, </strong></FONT></P><P =CodeSnippet style="MARGIN: 0in 0in 0pt 0.25in"><FONT style=": #e6e6e6" face="Courier New" color=#808080 size=2><strong>&nbsp;&nbsp;DateTime.Today - new&nbsp;TimeSpan(7, 0,0, 0));</strong></FONT></P><P =CodeSnippet style="MARGIN: 0in 0in 0pt 0.25in"><FONT style=": #e6e6e6" face="Courier New" color=#808080 size=2><strong>query1.AddSpan(EntityRelations.Customer_Order);</strong></FONT></P><P =CodeSnippet style="MARGIN: 0in 0in 0pt 0.25in"><FONT style=": #e6e6e6" face="Courier New" color=#808080 size=2><strong>query1.AddSpan(EntityRelations.Order_OrderDetail, </strong></FONT></P><P =CodeSnippet style="MARGIN: 0in 0in 0pt 0.25in"><strong><FONT color=#808080><FONT style=": #e6e6e6"><FONT face="Courier New" size=2>&nbsp;&nbsp;EntityRelations.Product_OrderDetail);</FONT><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Helvetica">&nbsp;</SPAN><SPAN style="FONT-FAMILY: Helvetica"><o:p></o:p></SPAN></FONT></FONT></strong></P><P =Ms&#111;normal style="MARGIN: 5pt 0in; LINE-HEIGHT: 13pt"><SPAN><strong>VB.NET:<o:p></o:p></strong></SPAN></P><P =CodeSnippet style="MARGIN: 0in 0in 0pt 0.25in"><FONT style=": #e6e6e6" face="Courier New" color=#808080 size=2><strong>Dim query1 As RdbQuery = New RdbQuery(GetType(Order), _</strong></FONT></P><P =CodeSnippet style="MARGIN: 0in 0in 0pt 0.25in"><FONT style=": #e6e6e6" face="Courier New" color=#808080 size=2><strong>&nbsp;&nbsp;Order.OrderDateEntityColumn, EntityQueryOp.GT, _</strong></FONT></P><P =CodeSnippet style="MARGIN: 0in 0in 0pt 0.25in"><FONT style=": #e6e6e6" face="Courier New" color=#808080 size=2><strong>&nbsp;&nbsp;DateTime.Today - new TimeSpan(7, 0, 0, 0))</strong></FONT></P><P =CodeSnippet style="MARGIN: 0in 0in 0pt 0.25in"><FONT style=": #e6e6e6" face="Courier New" color=#808080 size=2><strong>query1.AddSpan(EntityRelations.Customer_Order)</strong></FONT></P><P =CodeSnippet style="MARGIN: 0in 0in 0pt 0.25in"><strong><FONT style=": #e6e6e6" face="Courier New" color=#808080 size=2>query1.AddSpan(EntityRelations.Order_OrderDetail, _ &nbsp;&nbsp;EntityRelations.Product_OrderDetail)</FONT></strong></P><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: 13pt"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Helvetica"><o:p>&nbsp;</o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: 13pt"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Helvetica">Span queries provide a very effective method of quickly to collect a graph of business objects either for performance reasons or because the user wants to cache objects before going into disconnected mode.<o:p></o:p></SPAN></P>]]>
   </description>
   <pubDate>Wed, 06 Jun 2007 11:37:08 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=37&amp;PID=97#97</guid>
  </item> 
 </channel>
</rss>