/** @inheritdoc */ @Override public Long getKey(DBGroupThread entity) { if (entity != null) { return entity.getId(); } else { return null; } }
/** @inheritdoc */ @Override protected void bindValues(SQLiteStatement stmt, DBGroupThread entity) { stmt.clearBindings(); Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } Integer lights = entity.getLights(); if (lights != null) { stmt.bindLong(2, lights); } String username = entity.getUsername(); if (username != null) { stmt.bindString(3, username); } Long createAtUnixTime = entity.getCreateAtUnixTime(); if (createAtUnixTime != null) { stmt.bindLong(4, createAtUnixTime); } String title = entity.getTitle(); if (title != null) { stmt.bindString(5, title); } String note = entity.getNote(); if (note != null) { stmt.bindString(6, note); } Integer replies = entity.getReplies(); if (replies != null) { stmt.bindLong(7, replies); } Integer tid = entity.getTid(); if (tid != null) { stmt.bindLong(8, tid); } Long serverId = entity.getServerId(); if (serverId != null) { stmt.bindLong(9, serverId); } Long userId = entity.getUserId(); if (userId != null) { stmt.bindLong(10, userId); } Long coverId = entity.getCoverId(); if (coverId != null) { stmt.bindLong(11, coverId); } Long groupId = entity.getGroupId(); if (groupId != null) { stmt.bindLong(12, groupId); } }
/** @inheritdoc */ @Override protected Long updateKeyAfterInsert(DBGroupThread entity, long rowId) { entity.setId(rowId); return rowId; }
/** @inheritdoc */ @Override public void readEntity(Cursor cursor, DBGroupThread entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); entity.setLights(cursor.isNull(offset + 1) ? null : cursor.getInt(offset + 1)); entity.setUsername(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); entity.setCreateAtUnixTime(cursor.isNull(offset + 3) ? null : cursor.getLong(offset + 3)); entity.setTitle(cursor.isNull(offset + 4) ? null : cursor.getString(offset + 4)); entity.setNote(cursor.isNull(offset + 5) ? null : cursor.getString(offset + 5)); entity.setReplies(cursor.isNull(offset + 6) ? null : cursor.getInt(offset + 6)); entity.setTid(cursor.isNull(offset + 7) ? null : cursor.getInt(offset + 7)); entity.setServerId(cursor.isNull(offset + 8) ? null : cursor.getLong(offset + 8)); entity.setUserId(cursor.isNull(offset + 9) ? null : cursor.getLong(offset + 9)); entity.setCoverId(cursor.isNull(offset + 10) ? null : cursor.getLong(offset + 10)); entity.setGroupId(cursor.isNull(offset + 11) ? null : cursor.getLong(offset + 11)); }