@Override public ReadReceiptUserLink readEntity(Cursor cursor, int offset) { ReadReceiptUserLink entity = new ReadReceiptUserLink( // cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id cursor.isNull(offset + 1) ? null : cursor.getLong(offset + 1), // messageId cursor.isNull(offset + 2) ? null : cursor.getLong(offset + 2), // userId cursor.isNull(offset + 3) ? null : cursor.getInt(offset + 3), // status cursor.isNull(offset + 4) ? null : dateConverter.convertToEntityProperty(cursor.getLong(offset + 4)) // date ); return entity; }
@Override protected final void bindValues(SQLiteStatement stmt, ReadReceiptUserLink entity) { stmt.clearBindings(); Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } Long messageId = entity.getMessageId(); if (messageId != null) { stmt.bindLong(2, messageId); } Long userId = entity.getUserId(); if (userId != null) { stmt.bindLong(3, userId); } Integer status = entity.getStatus(); if (status != null) { stmt.bindLong(4, status); } DateTime date = entity.getDate(); if (date != null) { stmt.bindLong(5, dateConverter.convertToDatabaseValue(date)); } }
@Override protected final void bindValues(DatabaseStatement stmt, ReadReceiptUserLink entity) { stmt.clearBindings(); Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } Long messageId = entity.getMessageId(); if (messageId != null) { stmt.bindLong(2, messageId); } Long userId = entity.getUserId(); if (userId != null) { stmt.bindLong(3, userId); } Integer status = entity.getStatus(); if (status != null) { stmt.bindLong(4, status); } DateTime date = entity.getDate(); if (date != null) { stmt.bindLong(5, dateConverter.convertToDatabaseValue(date)); } }
@Override public void readEntity(Cursor cursor, ReadReceiptUserLink entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); entity.setMessageId(cursor.isNull(offset + 1) ? null : cursor.getLong(offset + 1)); entity.setUserId(cursor.isNull(offset + 2) ? null : cursor.getLong(offset + 2)); entity.setStatus(cursor.isNull(offset + 3) ? null : cursor.getInt(offset + 3)); entity.setDate(cursor.isNull(offset + 4) ? null : dateConverter.convertToEntityProperty(cursor.getLong(offset + 4))); }
stmt.bindLong(3, dateConverter.convertToDatabaseValue(date));
@Override public Message readEntity(Cursor cursor, int offset) { Message entity = new Message( // cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // entityID cursor.isNull(offset + 2) ? null : dateConverter.convertToEntityProperty(cursor.getLong(offset + 2)), // date cursor.isNull(offset + 3) ? null : cursor.getShort(offset + 3) != 0, // read cursor.isNull(offset + 4) ? null : cursor.getInt(offset + 4), // type cursor.isNull(offset + 5) ? null : cursor.getInt(offset + 5), // status cursor.isNull(offset + 6) ? null : cursor.getLong(offset + 6), // senderId cursor.isNull(offset + 7) ? null : cursor.getLong(offset + 7), // threadId cursor.isNull(offset + 8) ? null : cursor.getLong(offset + 8), // nextMessageId cursor.isNull(offset + 9) ? null : cursor.getLong(offset + 9) // lastMessageId ); return entity; }
stmt.bindLong(3, dateConverter.convertToDatabaseValue(date));
@Override public void readEntity(Cursor cursor, Message entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); entity.setEntityID(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); entity.setDate(cursor.isNull(offset + 2) ? null : dateConverter.convertToEntityProperty(cursor.getLong(offset + 2))); entity.setRead(cursor.isNull(offset + 3) ? null : cursor.getShort(offset + 3) != 0); entity.setType(cursor.isNull(offset + 4) ? null : cursor.getInt(offset + 4)); entity.setStatus(cursor.isNull(offset + 5) ? null : cursor.getInt(offset + 5)); entity.setSenderId(cursor.isNull(offset + 6) ? null : cursor.getLong(offset + 6)); entity.setThreadId(cursor.isNull(offset + 7) ? null : cursor.getLong(offset + 7)); entity.setNextMessageId(cursor.isNull(offset + 8) ? null : cursor.getLong(offset + 8)); entity.setLastMessageId(cursor.isNull(offset + 9) ? null : cursor.getLong(offset + 9)); }