title: database insert from a model, no such column exception,
body: <p>firstly i have trouble with creating database,then i want to put my received huge json datas(i converted json to java model by GsonBuilder and i saw all the datas in my entity[] list which made from ReceivedEntityModel class) to database,but i failed at first steps.it never creates my columns,so that after insertion there is 0 rowcount:(, i read all those answers about this topic and they didn't help me at all.I'm stuck.Anyone can help??</p>
  
  <pre><code> public void onCreate(SQLiteDatabase db)
   {
  
  String CREATE_M_ENTITY_TABLE = "CREATE TABLE " + TABLE_2_NAME + " ("
              + rId + " INTEGER PRIMARY KEY, "
              + ParentId + " INTEGER, "
              + Code+ " INTEGER, "
              + Label + " TEXT, "
              + LabelFL + " TEXT, "
              + EntityGroupId + " INTEGER, "
              + Property + " TEXT, "
              + ReportCode+ " INTEGER, "
              + Description + " TEXT, "
              + Code1Id + " INTEGER, "
              + Code2Id + " INTEGER, "
              + Code3Id + " INTEGER, "
              + Code4Id+ " INTEGER, "
              + Code5Id + " INTEGER, "
              + DefaultDimension1+ " INTEGER, "
              + DefaultDimension2 + "INTEGER, "
              + DefaultDimension3 + " INTEGER, "
              + CompanyId + " INTEGER, "
              + BranchId + " INTEGER, "
              + ReferenceDate + " TEXT, "
              + ResField1+ " TEXT, "
              + ResField2 + " TEXT, "
              + AreaId + " INTEGER, " 
              + ModifiedDateTime + " TEXT, "
              + CreatedDateTime + " TEXT, "
              + RecId + " INTEGER, "
              + IsActive + " BIT,"
              + ModifiedBy + " INTEGER,"
              + CreatedBy + " INTEGER" + ") ";
      db.execSQL(CREATE_M_ENTITY_TABLE);
  }
  </code></pre>
  
  <p>i call this function at main activity to bind listview</p>
  
  <pre><code>  public Cursor fetchEntities()
  
    {
      SQLiteDatabase db = dbHelper.getWritableDatabase();
          String myQuery="Select Code, Label from entity";
  
          Cursor mCursor=db.rawQuery(myQuery,null);
          int rowCount=mCursor.getCount();
      //Cursor mCursor = db.query(TABLE_2_NAME, new String[] {Code, Label }, null,null, null, null, null);
  
      if (mCursor != null) {
          mCursor.moveToFirst();
      }
      return mCursor;
  }
  </code></pre>
  
  <p>//as you see there is paramater like ReceivedEntityModel ,i get the datas from this Model's getters and i want to put them into a database is shown  below.</p>
  
  <pre><code>   public void AddNewEntity(ReceivedEntityModel[] entity)
  
   {
      // addnewentity 
      SQLiteDatabase db = dbHelper.getWritableDatabase();
      ContentValues values = new ContentValues();
  
      for (int i = 0; i &lt; entity.length; i++) {
          values.put(rId, entity[i].getRId());
          values.put(ParentId, entity[i].getParentId());
          values.put(Code, entity[i].getCode());
          values.put(Label, entity[i].getLabel());
          values.put(LabelFL, entity[i].getLabelFL());
          values.put(EntityGroupId, entity[i].getEntityGroupId());
          values.put(ReportCode, entity[i].getReportCode());
          values.put(Description, entity[i].getDescription());
          values.put(Code1Id, entity[i].getCode1Id());
          values.put(Code2Id, entity[i].getCode2Id());
          values.put(Code3Id, entity[i].getCode3Id());
          values.put(Code4Id, entity[i].getCode4Id());
          values.put(Code5Id, entity[i].getCode5Id());
          values.put(DefaultDimension1, entity[i].getDefaultDimension1Id());
          values.put(DefaultDimension2, entity[i].getDefaultDimension2Id());
          values.put(DefaultDimension3, entity[i].getDefaultDimension3Id());
          values.put(CompanyId, entity[i].getCompanyId());
          values.put(BranchId, entity[i].getBranchId());
          values.put(ReferenceDate, entity[i].getReferenceDate());
          values.put(ResField1, (String) entity[i].getResField1());
          values.put(ResField2, (String) entity[i].getResField2());
          values.put(AreaId, entity[i].getAreaId());
          values.put(ModifiedDateTime, entity[i].getModifiedDateTime());
          values.put(CreatedDateTime, entity[i].getCreatedDateTime());
          values.put(RecId, entity[i].getRecId());
          values.put(IsActive, entity[i].getIsActive());
          values.put(ModifiedBy, entity[i].getModifiedBy());
          values.put(CreatedBy, (String) entity[i].getCreatedBy());
  
  
  
      }
      db.insert(TABLE_2_NAME, null, values);
      db.close(); 
  }
  </code></pre>
  
  <p>this is Setup.java,fetchEntities(),AddNewEntity() functions are calling from there.Gson Builder make me a model.And the i call AddNewEntity()</p>
  
  <pre><code>    protected String doInBackground(String... urls) {
  
          entityReqestInfo = new EntityReqestInfo();
  
          String cevap = POST_FOR_ENTITY(urls[0], entityReqestInfo);
          GsonBuilder builder = new GsonBuilder();
          Gson gson = builder.create();
          receivedEM = gson.fromJson(cevap, ReceivedEntityModel[].class);
          myDB.getDatabaseEntityOperations().AddNewEntity(receivedEM);
  
          pDialog.cancel();
          return cevap;
  
      }
  </code></pre>
  
  <p>and last of all my generated entity Model ReceivedEntityModel class</p>
  
  <pre><code>   import java.util.ArrayList;
     import java.util.HashMap;
     import java.util.List;
     import java.util.Map;
  
         public class ReceivedEntityModel {
  
  private Integer rId;
  private Integer ParentId;
  private String Code;
  private String Label;
  private String LabelFL;
  private Integer EntityGroupId;
  private String Property;
  private String ReportCode;
  private String Description;
  private Integer Code1Id;
  private Integer Code2Id;
  private Integer Code3Id;
  private Integer Code4Id;
  private Integer Code5Id;
  private Integer DefaultDimension1Id;
  private Integer DefaultDimension2Id;
  private Integer DefaultDimension3Id;
  private Integer CompanyId;
  private Integer BranchId;
  private String ReferenceDate;
  private String ResField1;
  private String ResField2;
  private String AreaId;
  private String ModifiedDateTime;
  private String CreatedDateTime;
  private Integer RecId;
  private Boolean IsActive;
  private Integer ModifiedBy;
  private String CreatedBy;
  private String DBranch;
  private String DCompany;
  private String MEntityGroup;
  private List&lt;String&gt; MEntityTableModule = new ArrayList&lt;String&gt;();
  private Map&lt;String, String&gt; additionalProperties = new HashMap&lt;String, String&gt;();
  
  /**
   * 
   * @return The rId
   */
  public Integer getRId() {
      return rId;
  }
  
  /**
   * 
   * @param rId
   *            The rId
   */
  public void setRId(Integer rId) {
      this.rId = rId;
  }
  
  public ReceivedEntityModel withRId(Integer rId) {
      this.rId = rId;
      return this;
  }
  
  /**
   * 
   * @return The ParentId
   */
  public Integer getParentId() {
      return ParentId;
  }
  
  /**
   * 
   * @param ParentId
   *            The ParentId
   */
  public void setParentId(Integer ParentId) {
      this.ParentId = ParentId;
  }
  
  public ReceivedEntityModel withParentId(Integer ParentId) {
      this.ParentId = ParentId;
      return this;
  }
  
  /**
   * 
   * @return The Code
   */
  public String getCode() {
      return Code;
  }
  
  /**
   * 
   * @param Code
   *            The Code
   */
  public void setCode(String Code) {
      this.Code = Code;
  }
  
  public ReceivedEntityModel withCode(String Code) {
      this.Code = Code;
      return this;
  }
  
  /**
   * 
   * @return The Label
   */
  public String getLabel() {
      return Label;
  }
  
  /**
   * 
   * @param Label
   *            The Label
   */
  public void setLabel(String Label) {
      this.Label = Label;
  }
  
  public ReceivedEntityModel withLabel(String Label) {
      this.Label = Label;
      return this;
  }
  
  /**
   * 
   * @return The LabelFL
   */
  public String getLabelFL() {
      return LabelFL;
  }
  
  /**
   * 
   * @param LabelFL
   *            The LabelFL
   */
  public void setLabelFL(String LabelFL) {
      this.LabelFL = LabelFL;
  }
  
  public ReceivedEntityModel withLabelFL(String LabelFL) {
      this.LabelFL = LabelFL;
      return this;
  }
  
  /**
   * 
   * @return The EntityGroupId
   */
  public Integer getEntityGroupId() {
      return EntityGroupId;
  }
  
  /**
   * 
   * @param EntityGroupId
   *            The EntityGroupId
   */
  public void setEntityGroupId(Integer EntityGroupId) {
      this.EntityGroupId = EntityGroupId;
  }
  
  public ReceivedEntityModel withEntityGroupId(Integer EntityGroupId) {
      this.EntityGroupId = EntityGroupId;
      return this;
  }
  
  /**
   * 
   * @return The Property
   */
  public String getProperty() {
      return Property;
  }
  
  /**
   * 
   * @param Property
   *            The Property
   */
  public void setProperty(String Property) {
      this.Property = Property;
  }
  
  public ReceivedEntityModel withProperty(String Property) {
      this.Property = Property;
      return this;
  }
  
  /**
   * 
   * @return The ReportCode
   */
  public String getReportCode() {
      return ReportCode;
  }
  
  /**
   * 
   * @param ReportCode
   *            The ReportCode
   */
  public void setReportCode(String ReportCode) {
      this.ReportCode = ReportCode;
  }
  
  public ReceivedEntityModel withReportCode(String ReportCode) {
      this.ReportCode = ReportCode;
      return this;
  }
  
  /**
   * 
   * @return The Description
   */
  public String getDescription() {
      return Description;
  }
  
  /**
   * 
   * @param Description
   *            The Description
   */
  public void setDescription(String Description) {
      this.Description = Description;
  }
  
  public ReceivedEntityModel withDescription(String Description) {
      this.Description = Description;
      return this;
  }
  
  /**
   * 
   * @return The Code1Id
   */
  public Integer getCode1Id() {
      return Code1Id;
  }
  
  /**
   * 
   * @param Code1Id
   *            The Code1Id
   */
  public void setCode1Id(Integer Code1Id) {
      this.Code1Id = Code1Id;
  }
  
  public ReceivedEntityModel withCode1Id(Integer Code1Id) {
      this.Code1Id = Code1Id;
      return this;
  }
  
  /**
   * 
   * @return The Code2Id
   */
  public Integer getCode2Id() {
      return Code2Id;
  }
  
  /**
   * 
   * @param Code2Id
   *            The Code2Id
   */
  public void setCode2Id(Integer Code2Id) {
      this.Code2Id = Code2Id;
  }
  
  public ReceivedEntityModel withCode2Id(Integer Code2Id) {
      this.Code2Id = Code2Id;
      return this;
  }
  
  /**
   * 
   * @return The Code3Id
   */
  public Integer getCode3Id() {
      return Code3Id;
  }
  
  /**
   * 
   * @param Code3Id
   *            The Code3Id
   */
  public void setCode3Id(Integer Code3Id) {
      this.Code3Id = Code3Id;
  }
  
  public ReceivedEntityModel withCode3Id(Integer Code3Id) {
      this.Code3Id = Code3Id;
      return this;
  }
  
  /**
   * 
   * @return The Code4Id
   */
  public Integer getCode4Id() {
      return Code4Id;
  }
  
  /**
   * 
   * @param Code4Id
   *            The Code4Id
   */
  public void setCode4Id(Integer Code4Id) {
      this.Code4Id = Code4Id;
  }
  
  public ReceivedEntityModel withCode4Id(Integer Code4Id) {
      this.Code4Id = Code4Id;
      return this;
  }
  
  /**
   * 
   * @return The Code5Id
   */
  public Integer getCode5Id() {
      return Code5Id;
  }
  
  /**
   * 
   * @param Code5Id
   *            The Code5Id
   */
  public void setCode5Id(Integer Code5Id) {
      this.Code5Id = Code5Id;
  }
  
  public ReceivedEntityModel withCode5Id(Integer Code5Id) {
      this.Code5Id = Code5Id;
      return this;
  }
  
  /**
   * 
   * @return The DefaultDimension1Id
   */
  public Integer getDefaultDimension1Id() {
      return DefaultDimension1Id;
  }
  
  /**
   * 
   * @param DefaultDimension1Id
   *            The DefaultDimension1Id
   */
  public void setDefaultDimension1Id(Integer DefaultDimension1Id) {
      this.DefaultDimension1Id = DefaultDimension1Id;
  }
  
  public ReceivedEntityModel withDefaultDimension1Id(
          Integer DefaultDimension1Id) {
      this.DefaultDimension1Id = DefaultDimension1Id;
      return this;
  
  }
  
  /**
   * 
   * @return The DefaultDimension2Id
   */
  public Integer getDefaultDimension2Id() {
      return DefaultDimension2Id;
  }
  
  /**
   * 
   * @param DefaultDimension2Id
   *            The DefaultDimension2Id
   */
  public void setDefaultDimension2Id(Integer DefaultDimension2Id) {
      this.DefaultDimension2Id = DefaultDimension2Id;
  }
  
  public ReceivedEntityModel withDefaultDimension2Id(
          Integer DefaultDimension2Id) {
      this.DefaultDimension2Id = DefaultDimension2Id;
      return this;
  }
  
  /**
   * 
   * @return The DefaultDimension3Id
   */
  public Integer getDefaultDimension3Id() {
      return DefaultDimension3Id;
  }
  
  /**
   * 
   * @param DefaultDimension3Id
   *            The DefaultDimension3Id
   */
  public void setDefaultDimension3Id(Integer DefaultDimension3Id) {
      this.DefaultDimension3Id = DefaultDimension3Id;
  }
  
  public ReceivedEntityModel withDefaultDimension3Id(
          Integer DefaultDimension3Id) {
      this.DefaultDimension3Id = DefaultDimension3Id;
      return this;
  }
  
  /**
   * 
   * @return The CompanyId
   */
  public Integer getCompanyId() {
      return CompanyId;
  }
  
  /**
   * 
   * @param CompanyId
   *            The CompanyId
   */
  public void setCompanyId(Integer CompanyId) {
      this.CompanyId = CompanyId;
  }
  
  public ReceivedEntityModel withCompanyId(Integer CompanyId) {
      this.CompanyId = CompanyId;
      return this;
  }
  
  /**
   * 
   * @return The BranchId
   */
  public Integer getBranchId() {
      return BranchId;
  }
  
  /**
   * 
   * @param BranchId
   *            The BranchId
   */
  public void setBranchId(Integer BranchId) {
      this.BranchId = BranchId;
  }
  
  public ReceivedEntityModel withBranchId(Integer BranchId) {
      this.BranchId = BranchId;
      return this;
  }
  
  /**
   * 
   * @return The ReferenceDate
   */
  public String getReferenceDate() {
      return ReferenceDate;
  }
  
  /**
   * 
   * @param ReferenceDate
   *            The ReferenceDate
   */
  public void setReferenceDate(String ReferenceDate) {
      this.ReferenceDate = ReferenceDate;
  }
  
  public ReceivedEntityModel withReferenceDate(String ReferenceDate) {
      this.ReferenceDate = ReferenceDate;
      return this;
  }
  
  /**
   * 
   * @return The ResField1
   */
  public String getResField1() {
      return ResField1;
  }
  
  /**
   * 
   * @param ResField1
   *            The ResField1
   */
  public void setResField1(String ResField1) {
      this.ResField1 = ResField1;
  }
  
  public ReceivedEntityModel withResField1(String ResField1) {
      this.ResField1 = ResField1;
      return this;
  }
  
  /**
   * 
   * @return The ResField2
   */
  public String getResField2() {
      return ResField2;
  }
  
  /**
   * 
   * @param ResField2
   *            The ResField2
   */
  public void setResField2(String ResField2) {
      this.ResField2 = ResField2;
  }
  
  public ReceivedEntityModel withResField2(String ResField2) {
      this.ResField2 = ResField2;
      return this;
  }
  
  /**
   * 
   * @return The AreaId
   */
  public String getAreaId() {
      return AreaId;
  }
  
  /**
   * 
   * @param AreaId
   *            The AreaId
   */
  public void setAreaId(String AreaId) {
      this.AreaId = AreaId;
  }
  
  public ReceivedEntityModel withAreaId(String AreaId) {
      this.AreaId = AreaId;
      return this;
  }
  
  /**
   * 
   * @return The ModifiedDateTime
   */
  public String getModifiedDateTime() {
      return ModifiedDateTime;
  }
  
  /**
   * 
   * @param ModifiedDateTime
   *            The ModifiedDateTime
   */
  public void setModifiedDateTime(String ModifiedDateTime) {
      this.ModifiedDateTime = ModifiedDateTime;
  }
  
  public ReceivedEntityModel withModifiedDateTime(String ModifiedDateTime) {
      this.ModifiedDateTime = ModifiedDateTime;
      return this;
  }
  
  /**
   * 
   * @return The CreatedDateTime
   */
  public String getCreatedDateTime() {
      return CreatedDateTime;
  }
  
  /**
   * 
   * @param CreatedDateTime
   *            The CreatedDateTime
   */
  public void setCreatedDateTime(String CreatedDateTime) {
      this.CreatedDateTime = CreatedDateTime;
  }
  
  public ReceivedEntityModel withCreatedDateTime(String CreatedDateTime) {
      this.CreatedDateTime = CreatedDateTime;
      return this;
  }
  
  /**
   * 
   * @return The RecId
   */
  public Integer getRecId() {
      return RecId;
  }
  
  /**
   * 
   * @param RecId
   *            The RecId
   */
  public void setRecId(Integer RecId) {
      this.RecId = RecId;
  }
  
  public ReceivedEntityModel withRecId(Integer RecId) {
      this.RecId = RecId;
      return this;
  }
  
  /**
   * 
   * @return The IsActive
   */
  public Boolean getIsActive() {
      return IsActive;
  }
  
  /**
   * 
   * @param IsActive
   *            The IsActive
   */
  public void setIsActive(Boolean IsActive) {
      this.IsActive = IsActive;
  }
  
  public ReceivedEntityModel withIsActive(Boolean IsActive) {
      this.IsActive = IsActive;
      return this;
  }
  
  /**
   * 
   * @return The ModifiedBy
   */
  public Integer getModifiedBy() {
      return ModifiedBy;
  }
  
  /**
   * 
   * @param ModifiedBy
   *            The ModifiedBy
   */
  public void setModifiedBy(Integer ModifiedBy) {
      this.ModifiedBy = ModifiedBy;
  }
  
  public ReceivedEntityModel withModifiedBy(Integer ModifiedBy) {
      this.ModifiedBy = ModifiedBy;
      return this;
  }
  
  /**
   * 
   * @return The CreatedBy
   */
  public String getCreatedBy() {
      return CreatedBy;
  }
  
  /**
   * 
   * @param CreatedBy
   *            The CreatedBy
   */
  public void setCreatedBy(String CreatedBy) {
      this.CreatedBy = CreatedBy;
  }
  
  public ReceivedEntityModel withCreatedBy(String CreatedBy) {
      this.CreatedBy = CreatedBy;
      return this;
  }
  
  /**
   * 
   * @return The DBranch
   */
  public String getDBranch() {
      return DBranch;
  }
  
  /**
   * 
   * @param DBranch
   *            The D_Branch
   */
  public void setDBranch(String DBranch) {
      this.DBranch = DBranch;
  }
  
  public ReceivedEntityModel withDBranch(String DBranch) {
      this.DBranch = DBranch;
      return this;
  }
  
  /**
   * 
   * @return The DCompany
   */
  public String getDCompany() {
      return DCompany;
  }
  
  /**
   * 
   * @param DCompany
   *            The D_Company
   */
  public void setDCompany(String DCompany) {
      this.DCompany = DCompany;
  }
  
  public ReceivedEntityModel withDCompany(String DCompany) {
      this.DCompany = DCompany;
      return this;
  }
  
  /**
   * 
   * @return The MEntityGroup
   */
  public String getMEntityGroup() {
      return MEntityGroup;
  }
  
  /**
   * 
   * @param MEntityGroup
   *            The M_EntityGroup
   */
  public void setMEntityGroup(String MEntityGroup) {
      this.MEntityGroup = MEntityGroup;
  }
  
  public ReceivedEntityModel withMEntityGroup(String MEntityGroup) {
      this.MEntityGroup = MEntityGroup;
      return this;
  }
  
  /**
   * 
   * @return The MEntityTableModule
   */
  public List&lt;String&gt; getMEntityTableModule() {
      return MEntityTableModule;
  }
  
  /**
   * 
   * @param MEntityTableModule
   *            The M_EntityTableModule
   */
  public void setMEntityTableModule(List&lt;String&gt; MEntityTableModule) {
      this.MEntityTableModule = MEntityTableModule;
  }
  
  public ReceivedEntityModel withMEntityTableModule(
          List&lt;String&gt; MEntityTableModule) {
      this.MEntityTableModule = MEntityTableModule;
      return this;
  }
  
  public Map&lt;String, String&gt; getAdditionalProperties() {
      return this.additionalProperties;
  }
  
  public void setAdditionalProperty(String name, String value) {
      this.additionalProperties.put(name, value);
  }
  
  public ReceivedEntityModel withAdditionalProperty(String name, String value) {
      this.additionalProperties.put(name, value);
      return this;
  }
  </code></pre>
  
  <p>}</p>