public void addOrder(Order order) {
    SQLiteDatabase db = this.getWritableDatabase();

    ContentValues values = new ContentValues();
    values.put(KEY_ID, order.getId()); // Contact Name
    values.put(KEY_TABLE_ID, order.getTable().getId()); // Contact Phone Number
    values.put(KEY_CREATED_AT, order.getCreated_at());
    values.put(KEY_UPDATED_AT, order.getUpdated_at());

    // Inserting Row
    db.insert(TABLE_ORDERS, null, values);

    ordersAdapter.aNotifyDataSetChanged();
    db.close(); // Closing database connection
  }
  public void addOrders(List<Order> orders) {
    SQLiteDatabase db = this.getWritableDatabase();
    db.delete(TABLE_ORDERS, null, null);
    for (Order order : orders) {

      ContentValues values = new ContentValues();
      values.put(KEY_ID, order.getId());
      values.put(KEY_TABLE_ID, order.getTable_id());
      values.put(KEY_TOTAL, order.getTotal());
      values.put(KEY_READY, order.isReady());
      values.put(KEY_ACTIVE, order.isActive());
      values.put(KEY_CREATED_AT, order.getCreated_at());
      values.put(KEY_UPDATED_AT, order.getUpdated_at());

      // Inserting Row
      db.insert(TABLE_ORDERS, null, values);
    }

    db.close(); // Closing database connection
  }