code: public static long[] readIds(Cursor cursor) {
  		long[] arr = new long[cursor.getCount()];
  		int count = 0;
  		try {
  			while (cursor.moveToNext()) {
  				arr[count++] = cursor.getLong(0);
  			}
  		} finally {
  			cursor.close();
  		}
  		return arr;
  	}
docs: EntityManager