Code example for DatabaseUtils.InsertHelper

Methods: getColumnIndex

0
	 *     ���� � ������� YYYY-MM-DD 
	 * @param dishes 
	 *     {@link List} �� �������� {@link Dish} 
	 */ 
	public void addOrder(String date, List<Dish> dishes) {
		InsertHelper ih = new InsertHelper(mDb, DB_TABLE_ORDERS);
		 
		final int orDateI = ih.getColumnIndex(ORDERS_DATE_NAME);
		final int orDishIdI = ih.getColumnIndex(ORDERS_DISH_ID_NAME);
		 
		this.deleteOrderAtDate(date);
		 
		mDb.beginTransaction();
		try { 
			for (int i = 0; i < dishes.size(); i++) {
				ih.prepareForInsert();
				ih.bind(orDateI, date);
				ih.bind(orDishIdI, dishes.get(i).getId());
				ih.execute();
			} 
Stop searching for code, let great code find you!  Add Codota to your java IDE