<commit_before>package ve.com.abicelis.chefbuddy.database;

import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;

import java.util.ArrayList;
import java.util.List;

import ve.com.abicelis.chefbuddy.database.exceptions.CouldNotGetDataException;
import ve.com.abicelis.chefbuddy.enums.Measurement;
import ve.com.abicelis.chefbuddy.enums.PreparationTimeType;
import ve.com.abicelis.chefbuddy.model.Ingredient;
import ve.com.abicelis.chefbuddy.model.Recipe;


/**
 * Created by abicelis on 3/7/2017.
 */
public class ChefBuddyDAO {

    private ChefBuddyDbHelper mDatabaseHelper;

    public ChefBuddyDAO(ChefBuddyDbHelper chefBuddyDbHelper) {
        mDatabaseHelper = chefBuddyDbHelper;
    }


    /**
     * Returns the List of Recipes stored in the database without the
     */
    public List<Recipe> getRecipes() throws CouldNotGetDataException {
        List<Recipe> recipes = new ArrayList<>();
        SQLiteDatabase db = mDatabaseHelper.getReadableDatabase();
        Cursor cursor = db.query(ChefBuddyContract.RecipeTable.TABLE_NAME, null, null, null, null, null, null);<commit_msg>Moved enums to model<commit_after>package ve.com.abicelis.chefbuddy.database;

import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;

import java.util.ArrayList;
import java.util.List;

import ve.com.abicelis.chefbuddy.database.exceptions.CouldNotGetDataException;
import ve.com.abicelis.chefbuddy.model.Measurement;
import ve.com.abicelis.chefbuddy.model.PreparationTimeType;
import ve.com.abicelis.chefbuddy.model.Ingredient;
import ve.com.abicelis.chefbuddy.model.Recipe;


/**
 * Created by abicelis on 3/7/2017.
 */
public class ChefBuddyDAO {

    private ChefBuddyDbHelper mDatabaseHelper;

    public ChefBuddyDAO(ChefBuddyDbHelper chefBuddyDbHelper) {
        mDatabaseHelper = chefBuddyDbHelper;
    }


    /**
     * Returns the List of Recipes stored in the database without the
     */
    public List<Recipe> getRecipes() throws CouldNotGetDataException {
        List<Recipe> recipes = new ArrayList<>();
        SQLiteDatabase db = mDatabaseHelper.getReadableDatabase();
        Cursor cursor = db.query(ChefBuddyContract.RecipeTable.TABLE_NAME, null, null, null, null, null, null);
{'fraction_non_alphanumeric': 0.09460062472110665, 'fraction_numerical': 0.00535475234270415, 'mean_word_length': 4.441747572815534, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2770576', 'n_tokens_mistral': 772, 'n_tokens_neox': 729, 'n_words': 138}