Code example for Cursor

Methods: getLongisNull

0
    } 
 
    /** @inheritdoc */ 
    @Override 
    public Long readKey(Cursor cursor, int offset) {
        return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0);
    }     
 
    /** @inheritdoc */ 
    @Override 
    public AutoincrementEntity readEntity(Cursor cursor, int offset) {
        AutoincrementEntity entity = new AutoincrementEntity( //
            cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0) // id
        ); 
        return entity;
    } 
      
    /** @inheritdoc */ 
    @Override 
    public void readEntity(Cursor cursor, AutoincrementEntity entity, int offset) {
        entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0));