Code example for Cursor

Methods: getBlobgetIntgetLonggetString

0
	private static LibraryBook doConvertRow(Cursor cursor) {
		 
		LibraryBook newBook = new LibraryBook();
		 
		newBook.setAuthor(new Author( 
				cursor.getString(Field.a_first_name.ordinal()), 
				cursor.getString(Field.a_last_name.ordinal())));
		 
		newBook.setTitle( cursor.getString(Field.title.ordinal()));
		 
		newBook.setDescription(cursor.getString(Field.description.ordinal()));
		 
		try { 
			newBook.setAddedToLibrary(new Date(cursor.getLong(Field.date_added.ordinal())));
		} catch (RuntimeException r){}
		 
		try { 
			newBook.setLastRead(new Date(cursor.getLong(Field.date_last_read.ordinal())));
		} catch (RuntimeException r){}
		 
		byte[] coverData = cursor.getBlob(Field.cover_image.ordinal());
		newBook.setCoverImage(coverData);			
		 
		newBook.setFileName( cursor.getString(Field.file_name.ordinal()));
		 
		newBook.setProgress(cursor.getInt(Field.progress.ordinal()));
		 
		return newBook;
	} 
	 
	//public void createOrUpdateBook(