Im trying to create an sqlite table with the following query.

```
"CREATE TABLE " + TABLE_COMPLIANCE_STATUS + "("
        + KEY_ID + " INTEGER PRIMARY KEY,"
        + KEY_YEAR + " TEXT,"
        + KEY_DELAYED_COMPLIANCE + " TEXT,"
        + KEY_NOT_COMPLIED + " TEXT" + ")";

```

Im adding values to db using the following code

`db.addComplianceStatus(new ComplianceStatusModel(i, String.valueOf(year), String.valueOf(delayedCompliance), String.valueOf(notCompliance)));`

Im reading the contents of db as follows,

```
List<ComplianceStatusModel>  notifications = db.getAllComplianceStatus();
for (ComplianceStatusModel notify : notifications) {
    String log = "Id: "+notify.getId()+" ,Description: " + notify.getYear() + " ,Date: " + notify.getDelayedCompliance();
    // Writing Compliances to log
    Toast.makeText(getActivity().getApplicationContext(),log,Toast.LENGTH_SHORT).show();
}

```

This returns an empty array. What could be my error? When I tried printing Logging the db, it prints the memory address though.

Following is my getAllComplianceModel method

```
public List<ComplianceStatusModel> getAllComplianceStatus() {
        List<ComplianceStatusModel> complianceStatusModelList = new ArrayList<ComplianceStatusModel>();
        // Select All Query
        String selectQuery = "SELECT  * FROM " + TABLE_COMPLIANCE_STATUS;

        SQLiteDatabase db = this.getWritableDatabase();
        Cursor cursor = db.rawQuery(selectQuery, null);

        // looping through all rows and adding to list
        if (cursor.moveToFirst()) {
            do {
                ComplianceStatusModel complianceStatusModel = new ComplianceStatusModel();

                complianceStatusModel.setId(Integer.parseInt(cursor.getString(0)));
                complianceStatusModel.setYear(cursor.getString(1));
                complianceStatusModel.setDelayedCompliance(cursor.getString(2));
                complianceStatusModel.setNotComplied(cursor.getString(3));

                complianceStatusModelList.add(complianceStatusModel);
            } while (cursor.moveToNext());
        }
        return complianceStatusModelList;
    }

```

Following is addComplianceStatus method

```
public void addComplianceStatus(ComplianceStatusModel complianceStatus) {
    SQLiteDatabase sqLiteDatabase = this.getWritableDatabase();
    ContentValues contentValues = new ContentValues();

    contentValues.put(KEY_ID, complianceStatus.getId());
    contentValues.put(KEY_YEAR, complianceStatus.getYear());
    contentValues.put(KEY_DELAYED_COMPLIANCE, complianceStatus.getDelayedCompliance());
    contentValues.put(KEY_NOT_COMPLIED, complianceStatus.getNotComplied());
}

```