title: SOQL join query returns sObject but not fields. How to use the obtained ID?
body: <p>I have SOQL below and I get the result that contains sObject's ID.
  My assumption was the query will return the fields of SObject as well.
  For instance my query try to get "<code>startDay__c</code>" (The date) which is like field of ShigotoShousai sobject. But result of query is just ID of the sObject instance.</p>
  
  <p>(<strong>parent</strong>: <code>ShigotoShousai</code>   <strong>child</strong>: <code>ShigotoAssign</code>)</p>
  
  <pre><code>sObject[] result = [
    SELECT
    ShigotoShousai__r.id, 
    ShigotoShousai__r.startDay__c
    FROM ShigotoAssign__c
  ];
  </code></pre>
  
  <p><strong>system.debug(result) output</strong></p>
  
  <p>shigotoAssign_<em>c:{Id=a06500000067aNjAAI, ShigotoShousai</em>_c=a055000000DlHnOAAV}, shigotoAssign_<em>c:{Id=a06500000067aNoAAI, ShigotoShousai</em>_c=a055000000DlHnTAAV})</p>
  
  <p>I got ID of ShigotoShousai__c sObject instead of its property "<code>startDay__c</code>".
  I thought output would be something like:</p>
  
  <pre><code>shigotoAssign__c:{ShigotoShousai__c=a055000000DlHnOAAV, startDay__c=2010-10-10}, 
  shigotoAssign__c:{ShigotoShousai__c=a055000000DlHnTAAV, startDay__c=2010-10-13})
  </code></pre>
  
  <p>But query result just returned me ID of ShigotoShousai__c sobject :(</p>
  
  <p>Now I know have ID value of S<code>higotoShousai__c</code> and want to access its field so I did following.</p>
  
  <pre><code>ShigotoShousai__c foo = (ShigotoShousai__c)result[0].get('ShigotoShousai__c');
  //now I assume I can access to some fields like below
  system.debug(foo.workDate);
  </code></pre>
  
  <p>And this gives me error:</p>
  
  <pre><code>System.TypeException: Invalid conversion from runtime 
  type Id to SOBJECT:shigotoShousai__c
  </code></pre>
  
  <p>Then I figured that ID cannot be used to refer to SObject (i.e. ShigotoShousai__c).</p>
  
  <p>But I have its id.. How can I access, say <code>startDay__c</code>? Is there a way to use this ID? </p>