title: Using Retrofit and GreenDao with nested json objects
body: <p>I want to combine Retrofit and GreenDao but I have a problem with nested Json-Objects. My nested fields remain empty.</p>
  
  <p>This is the Json DataStructure </p>
  
  <pre><code>[
      {
          "id": 1, 
          "street": "Streetname", 
          "zipcode": 12345, 
          "city": "MyCity", 
          "phone_number": "+123456789", 
          "position": "12.0000, 9.0000", 
          "company": {
              "title": "CompanyName", 
              "group": {
                  "title": "GroupName"
              }
          }
      }
  ]
  </code></pre>
  
  <p>My DaoGenerator looks like this</p>
  
  <pre><code>    Entity customItem = schema.addEntity("CustomItems");
      customItem.addIdProperty();
      customItem.addStringProperty("street");
      customItem.addIntProperty("zipcode");
      customItem.addStringProperty("city");
      customItem.addStringProperty("phone_number");
      customItem.addStringProperty("position");
  
      Entity company = schema.addEntity("Company");
      company.addIdProperty();
      company.addStringProperty("title");
  
      Entity group = schema.addEntity("Group");
      group.addIdProperty();
      group.addStringProperty("title");
  
      Property companyPropId = customItem.addLongProperty("companyId").notNull().getProperty();
      customItem.addToOne(company, companyPropId);
  
      Property groupPropId = company.addLongProperty("groupId").notNull().getProperty();
      company.addToOne(group, groupPropId);
  </code></pre>
  
  <p>My problem is that customItem.getCompany() returns null but the values "id" to "position" are fine. I'm not sure what the problem is as my CustomItem class contains the member</p>
  
  <pre><code>private Company company;
  </code></pre>
  
  <p>and the setter for the company and I can't see any typo.</p>
  
  <pre><code>public void setCompany(Company company) {
      if (company == null) {
          throw new DaoException("To-one property 'companyId' has not-null constraint; cannot set to-one to null");
      }
      synchronized (this) {
          this.company = company;
          companyId = company.getId();
          company__resolvedKey = companyId;
      }
  }
  </code></pre>