@Override
    public Ingredient retrieveIngredient(String name) throws DataStoreException{

        name = name.toLowerCase();

        if( isIngredientCacheValid ){
            for ( Ingredient ingredient : ingredientCache ) {
                if( ingredient.getSingular().equals("name")){
                    return ingredient;
                }
            }
        }

        Ingredient result = null;
        try ( Connection conn = getConnection();
              ResultSet rs = executeStatement(conn,
                      "SELECT name_singular, name_plural, common FROM ingredients WHERE " +
                              "name_singular='" + escapeQuotes(name) + "' OR " +
                              "name_plural='" + escapeQuotes(name) + "'")){

            if(rs != null){
                while(rs.next()){
                    String singular = rs.getString("name_singular");
                    String plural = rs.getString("name_plural");
                    Boolean common = rs.getBoolean("common");
                    result = new Ingredient(singular, plural, common);
                }
            }

        } catch (SQLException e){
            LOGGER.error("Exception while retrieving ingredient: " + e.getMessage());
            throw new DataStoreException(e.getMessage());
        }
        return result;
    }