@Override public SimpleEntityNotNull readEntity(Cursor cursor, int offset) { SimpleEntityNotNull entity = new SimpleEntityNotNull( // cursor.getLong(offset + 0), // id cursor.getShort(offset + 1) != 0, // simpleBoolean (byte) cursor.getShort(offset + 2), // simpleByte cursor.getShort(offset + 3), // simpleShort cursor.getInt(offset + 4), // simpleInt cursor.getLong(offset + 5), // simpleLong cursor.getFloat(offset + 6), // simpleFloat cursor.getDouble(offset + 7), // simpleDouble cursor.getString(offset + 8), // simpleString cursor.getBlob(offset + 9) // simpleByteArray ); return entity; }
public static SimpleEntityNotNull createEntity(Long key) { if (key == null) { return null; } SimpleEntityNotNull entity = new SimpleEntityNotNull(); entity.setId(key); entity.setSimpleBoolean(true); entity.setSimpleByte(Byte.MAX_VALUE); entity.setSimpleShort(Short.MAX_VALUE); entity.setSimpleInt(Integer.MAX_VALUE); entity.setSimpleLong(Long.MAX_VALUE); entity.setSimpleFloat(Float.MAX_VALUE); entity.setSimpleDouble(Double.MAX_VALUE); entity.setSimpleString("greenrobot greenDAO"); byte[] bytes = { 42, -17, 23, 0, 127, -128 }; entity.setSimpleByteArray(bytes); return entity; } }