public void save() {
        ContentValues values = new ContentValues();

        for (Field f : Database.getDBFields(getClass())) {
            String ff = f.getName();
            try {
                if (Model.class.isAssignableFrom(f.getType())) {
                    values.put(ff, ((Model<?>) f.get(this)).id);
                } else {
                    if (f.getType().equals(String.class))
                        values.put(ff, (String) f.get(this));
                    if (f.getType().equals(byte[].class))
                        values.put(ff, (byte[]) f.get(this));
                    if (f.getType().equals(int.class))
                        values.put(ff, (Integer) f.get(this));
                    if (f.getType().equals(long.class))
                        values.put(ff, (Long) f.get(this));
                }
            } catch (Exception e) {
                Util.Log(e);
            }
        }

        if (id == null) {
            id = mDB.sql.insert(mTable, null, values);
            Application.getDatabase().registerObject(this);
        } else
            mDB.sql.update(mTable, values, "id=" + id, null);

        mDB.notifyUpdated(this);

        mOldHash = hashCode();
    }