public abstract class RecipeDao
extends java.lang.Object
Constructor and Description |
---|
RecipeDao() |
Modifier and Type | Method and Description |
---|---|
abstract void |
addRecipeToFavorites(int recipeId)
This function to add a recipe which has is_favourite = 1 to Favourites
|
abstract int |
countFavoriteRecipes()
This function to count favourite recipes where is_favourite = 1
|
abstract int |
countIngredients(int uid)
This function to count ingredients in a recipe;
|
abstract int |
countLocalRecipes()
This function to count local recipes where is_custom = 1
|
abstract int |
countRecipes()
This function to count recipes
|
abstract void |
deleteIngredient(Ingredient ingredient)
This function to delete an ingredient
|
abstract void |
deleteRecipe(Recipe recipe)
This function to delete a recipe
|
abstract void |
deleteRecipeFromFavorites(int recipeId)
This function is used to delete a recipe which has is_favourite = 0 from Favourites
|
abstract void |
deleteRecipeWithIngredients(Recipe recipe,
java.util.List<Ingredient> ingredients)
This function to delete recipe with all ingredients.
|
abstract java.util.List<Ingredient> |
getAllIngredients()
This function to get all ingredients
|
abstract java.util.List<Recipe> |
getAllRecipes()
This function is to get a all recipes as a list
|
abstract java.util.List<RecipeWithIngredients> |
getFavoriteRecipeWithIngredients()
This function to get list of Favourite recipes with ingredients
|
abstract java.util.List<Ingredient> |
getIngredientsById(int uid)
This function to get list of ingredients by using recipeId
|
abstract java.util.List<RecipeWithIngredients> |
getLocalRecipeWithIngredients()
This function to get list of local recipes with ingredients
|
abstract java.util.List<RecipeWithIngredients> |
getPremadeRecipeWithIngredients()
This function to get list of pre-made recipes with ingredients
|
abstract Recipe |
getRecipeById(int uid)
This function to get a recipe by its Id.
|
abstract java.util.List<RecipeWithIngredients> |
getRecipeWithIngredients()
This method returns all recipes with its ingredients
|
abstract RecipeWithIngredients |
getRecipeWithIngredientsByRecipeId(int recipeId)
This function to search for recipe by its Id
|
abstract void |
insertAllIngredients(java.util.List<Ingredient> ingredients)
This function to insert all ingredients for the List of ingredients
|
abstract void |
insertIngredient(Ingredient ingredient)
This function to insert ingredient
|
abstract long |
insertRecipe(Recipe recipe)
This function to insert recipe
|
void |
insertRecipeWithIngredients(Recipe recipe,
java.util.List<Ingredient> ingredients)
This is a priority function.
|
abstract java.util.List<Recipe> |
searchRecipeByName(java.lang.String search)
This function to search for a recipe by its name.
|
abstract java.util.List<RecipeWithIngredients> |
searchRecipeWithIngredientsByName(java.lang.String search)
This function to search for a recipe by its name.
|
abstract void |
updateIngredient(Ingredient Ingredient)
This function is for update ingredient
|
abstract void |
updateIngredientWithRecipe(Recipe recipe,
java.util.List<Ingredient> ingredients)
This function is for update all ingredients with corresponding recipe
|
abstract void |
updateRecipe(Recipe recipe)
This function is for update a recipe
|
public abstract int countRecipes()
public abstract int countLocalRecipes()
public abstract int countFavoriteRecipes()
public abstract int countIngredients(int uid)
public abstract java.util.List<Recipe> getAllRecipes()
public abstract java.util.List<RecipeWithIngredients> getRecipeWithIngredients()
public abstract java.util.List<RecipeWithIngredients> getPremadeRecipeWithIngredients()
public abstract java.util.List<RecipeWithIngredients> getLocalRecipeWithIngredients()
public abstract java.util.List<RecipeWithIngredients> getFavoriteRecipeWithIngredients()
public abstract java.util.List<Ingredient> getAllIngredients()
public abstract java.util.List<Ingredient> getIngredientsById(int uid)
uid
- recipeId of the attached recipepublic abstract long insertRecipe(Recipe recipe)
recipe
- Recipe to insertpublic abstract void insertIngredient(Ingredient ingredient)
ingredient
- Ingredient to insertpublic abstract void insertAllIngredients(java.util.List<Ingredient> ingredients)
ingredients
- List of ingredients to insertpublic void insertRecipeWithIngredients(Recipe recipe, java.util.List<Ingredient> ingredients)
recipe
- Recipe to insertingredients
- List of ingredients to attach to that recipe and insertpublic abstract void deleteRecipe(Recipe recipe)
recipe
- Recipe to deletepublic abstract void deleteIngredient(Ingredient ingredient)
ingredient
- Ingredients to deletepublic abstract void deleteRecipeWithIngredients(Recipe recipe, java.util.List<Ingredient> ingredients)
recipe
- Recipe to deleteingredients
- List of ingredients to deletepublic abstract Recipe getRecipeById(int uid)
uid
- id of the recipepublic abstract java.util.List<Recipe> searchRecipeByName(java.lang.String search)
search
- Name to search forpublic abstract java.util.List<RecipeWithIngredients> searchRecipeWithIngredientsByName(java.lang.String search)
search
- Name to search forpublic abstract RecipeWithIngredients getRecipeWithIngredientsByRecipeId(int recipeId)
recipeId
- recipeId to search forpublic abstract void addRecipeToFavorites(int recipeId)
recipeId
- recipeId of a recipe to updatepublic abstract void deleteRecipeFromFavorites(int recipeId)
recipeId
- recipeId of a recipe to updatepublic abstract void updateRecipe(Recipe recipe)
recipe
- Recipe to updatepublic abstract void updateIngredient(Ingredient Ingredient)
Ingredient
- Ingredient to updatepublic abstract void updateIngredientWithRecipe(Recipe recipe, java.util.List<Ingredient> ingredients)
recipe
- Recipe to updateingredients
- Ingredients to update