/** @inheritdoc */ @Override public String getKey(User entity) { if (entity != null) { return entity.getUsername(); } else { return null; } }
/** @inheritdoc */ @Override protected void bindValues(SQLiteStatement stmt, User entity) { stmt.clearBindings(); stmt.bindString(1, entity.getUsername()); stmt.bindString(2, entity.getPassword()); String full_name = entity.getFull_name(); if (full_name != null) { stmt.bindString(3, full_name); } String gender = entity.getGender(); if (gender != null) { stmt.bindString(4, gender); } Integer age = entity.getAge(); if (age != null) { stmt.bindLong(5, age); } String location = entity.getLocation(); if (location != null) { stmt.bindString(6, location); } String about = entity.getAbout(); if (about != null) { stmt.bindString(7, about); } Long joined = entity.getJoined(); if (joined != null) { stmt.bindLong(8, joined); } Long last_login = entity.getLast_login(); if (last_login != null) { stmt.bindLong(9, last_login); } String avatar = entity.getAvatar(); if (avatar != null) { stmt.bindString(10, avatar); } String url = entity.getUrl(); if (url != null) { stmt.bindString(11, url); } String share_text_watched = entity.getShare_text_watched(); if (share_text_watched != null) { stmt.bindString(12, share_text_watched); } String share_text_watching = entity.getShare_text_watching(); if (share_text_watching != null) { stmt.bindString(13, share_text_watching); } }
/** @inheritdoc */ @Override protected String updateKeyAfterInsert(User entity, long rowId) { return entity.getUsername(); }
/** @inheritdoc */ @Override public void readEntity(Cursor cursor, User entity, int offset) { entity.setUsername(cursor.getString(offset + 0)); entity.setPassword(cursor.getString(offset + 1)); entity.setFull_name(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); entity.setGender(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); entity.setAge(cursor.isNull(offset + 4) ? null : cursor.getInt(offset + 4)); entity.setLocation(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); entity.setAbout(cursor.isNull(offset + 6) ? null : cursor.getString(offset + 6)); entity.setJoined(cursor.isNull(offset + 7) ? null : cursor.getLong(offset + 7)); entity.setLast_login(cursor.isNull(offset + 8) ? null : cursor.getLong(offset + 8)); entity.setAvatar(cursor.isNull(offset + 9) ? null : cursor.getString(offset + 9)); entity.setUrl(cursor.isNull(offset + 10) ? null : cursor.getString(offset + 10)); entity.setShare_text_watched(cursor.isNull(offset + 11) ? null : cursor.getString(offset + 11)); entity.setShare_text_watching( cursor.isNull(offset + 12) ? null : cursor.getString(offset + 12)); }