title: What does Preload function do in gorm?
body: <p>The link <a href="http://gorm.io/docs/preload.html" rel="noreferrer">http://gorm.io/docs/preload.html</a> talks about preloading in GORM, but I am unable to understand what this function does.</p>
  
  <pre><code>type User struct {
    gorm.Model
    Username string
    Orders Order
  }
  type Order struct {
    gorm.Model
    UserID uint
    Price float64
  }
  
  
  db.Preload("Username")
  
  db.Preload("Orders").Find(&amp;users)
  
  </code></pre>
  
  <p>Can someone explain what will these 2 statements do? What will be the output ?</p>
  
  <p>Is it that <code>preload</code> is used to cache the results?</p>