title: Extjs 5.0 nested association in model causing error = Ext.data.schema.Schema.addEntity(): Duplicate entity name
body: <p>I am having trouble setting the associations with nested references that are reused across different models.</p>
  
  <p>How can do this?</p>
  
  <p>AddressModel</p>
  
  <pre><code>    Ext.define('POC.model.AddressModel', 
      {
          extend: 'Ext.data.Model',    
          fields: [             
                   { name:'id', type:'string' },
                   { name:'line1', type:'string' },
                   { name:'line2', type:'string' },
                   { name:'city', type:'string' },             
                   { name:'state', type:'string'},
                   { name:'zip', type:'string'}
               ]
      });
  </code></pre>
  
  <p>Applicant Model</p>
  
  <pre><code>    Ext.define('POC.model.ApplicantModel', 
      {
          extend: 'POC.model.Base',
          requires: [
                     "POC.model.field.PhoneNumber",  
                     "POC.model.AddressModel"
                 ],
          fields: [             
                   { name:'id', type:'string' },             
                   { name:'applicantName', type:'string'}, 
                   { name:'mailingAddress', reference:'AddressModel'} 
               ]
      });
  </code></pre>
  
  <p>Company Model</p>
  
  <pre><code>    Ext.define('POC.model.CompanyInfoModel', 
      {
          requires: [
                     "POC.model.field.PhoneNumber",  
                     "POC.model.AddressModel"
                 ],
          extend: 'Ext.data.Model',    
          fields: [             
                   { name:'id', type:'string'},
                   { name:'contacttype', type:'string' },
                   { name:'contactname', type:'string' },
                   { name:'primaryphone', type:'phonenumber' },
                   { name:'secphone', type:'phonenumber' },             
                   { name:'primaryemail', type:'string'},
                   { name:'secemail', type:'string'},
                   { name:'address', reference:'AddressModel'}            
               ]     
      });
  </code></pre>
  
  <p>Agent Model</p>
  
  <pre><code>    Ext.define('POC.model.AgentInfoModel', 
      {
          extend: 'Ext.data.Model',
          requires: [
                     "POC.model.field.PhoneNumber",  
                     "POC.model.AddressModel"
                 ],
          fields: [             
                   { name:'id', type:'string'},
                   { name:'agencyname', type:'string' },
                   { name:'contactname', type:'string' },
                   { name:'phone', type:'phonenumber' },             
                   { name:'code', type:'string'},
                   { name:'email', type:'string'},
                   { name:'address', reference:'AddressModel'}
               ]
      });
  </code></pre>
  
  <p>Everything comes together in Application Model</p>
  
  <pre><code>    Ext.define('POC.model.ApplicationInfoModel', 
      {
          requires:['POC.model.AgentInfoModel',
                    'POC.model.CompanyInfoModel',
                    'POC.model.ApplicantModel'
                    ],
          extend: 'POC.model.Base',
          idProperty:'appid',
          fields:[{
                      name:'appid',type:'string'
                  },
                  {
                      name:'agent',
                      reference:'AgentInfoModel'
                  },
                  {
                      name:'company',
                      reference:'CompanyInfoModel'
                  }           
                  ],
          hasMany:[{
              name:'applicants',
              reference:'ApplicantModel'
          }]
      });
  </code></pre>
  
  <p>The associated JSON format from the server</p>
  
  <pre><code>    {
          "success":true,
          "application" : 
          {
              "appid":"0",
              "company" : 
              {
                  "id" : "0",
                  "contacttype" : "",
                  "contactname" : "",
                  "primaryphone" : "",
                  "secphone" : "",
                  "primaryemail" : "",
                  "secemail" : "",
                  "address" : {
                      "id":"114444",
                      "line1" : "",
                      "line2" : "",
                      "city" : "",
                      "state" : "",
                      "zip" : ""
                  }
              },
              "agent" : {
                  "id" : "0",
                  "agencyname" : "",
                  "contactname" : "",
                  "phone" : "",
                  "code" : "",
                  "email" : "",
                  "address" : {
                      "id":"11111",
                      "line1" : "",
                      "line2" : "",
                      "city" : "",
                      "state" : "",
                      "zip" : ""
                  }
              },
              "applicants" :
              [{
                      "id" : "0",             
                      "applicantName" : "",
                      "mailingAddress" : 
                      {
                          "id":"1132323",
                          "line1" : "",
                          "line2" : "",
                          "city" : "",
                          "state" : "",
                          "zip" : ""
                      }
                  }, {
                      "id" : "1",
                      "applicantName" : "",
                      "mailingAddress" : 
                      {
                          "id":"11323666",
                          "line1" : "",
                          "line2" : "",
                          "city" : "",
                          "state" : "",
                          "zip" : ""
                      }
                  }
  
              ]
  
          }
      }
  </code></pre>
  
  <p>The error that I get...</p>
  
  <p>**W] [Ext.define] Duplicate class name 'POC.model.AddressModel' specified, must be a              non-  empty string Util.js:692</p>
  
  <p>[E] Ext.data.schema.Schema.addEntity(): Duplicate entity name "AddressModel": POC.model.AddressModel and POC.model.AddressModel </p>
  
  <p>Uncaught Error: Duplicate entity name "AddressModel": POC.model.AddressModel and POC.model.AddressModel** </p>