// Path: src/main/java/cn/com/chenyixiao/rrs/dao/FoodDAO.java
// public interface FoodDAO {
// 
// 	public void addFood(Food food);
// 	public void updateFood(Food food);
// 	public Food getFood(Long id);
// 	public List<Food> getAllFoods();
// 	public void deleteFood(Long id);
// 	public void deleteAllFoods();
// 	
// 	public Long count();
// 	
// 	public Food findByName(String name);
// }
// 
// Path: src/main/java/cn/com/chenyixiao/rrs/dao/RestaurantFoodDAO.java
// public interface RestaurantFoodDAO {
// 
// 	public void addRestaurantFood(RestaurantFood restaurantFood);
// 	public void updateRestaurantFood(RestaurantFood restaurantFood);
// 	public RestaurantFood getRestaurantFood(Long id);
// 	public List<RestaurantFood> getAllRestaurantFoods();
// 	public void deleteRestaurantFood(Long id);
// 	public void deleteAllRestaurantFood();
// 	
// 	public Long count();
// 	
// 	public List<RestaurantFood> getRestaurantFoodsByRestaurantId(Long restaurantId);
// }
// 
// Path: src/main/java/cn/com/chenyixiao/rrs/entity/Food.java
// @Entity
// @Table(name = "food", catalog = "rrs")
// public class Food implements java.io.Serializable {
// 
// 	private long id;
// 	private String name;
// 
// 	public Food() {
// 	}
// 
// 	public Food(long id) {
// 		this.id = id;
// 	}
// 
// 	public Food(long id, String name) {
// 		this.id = id;
// 		this.name = name;
// 	}
// 
// 	@Id
// 	@GeneratedValue(strategy = GenerationType.IDENTITY)
// 	@Column(name = "id", unique = true, nullable = false)
// 	public long getId() {
// 		return this.id;
// 	}
// 
// 	public void setId(long id) {
// 		this.id = id;
// 	}
// 
// 	@Column(name = "name")
// 	public String getName() {
// 		return this.name;
// 	}
// 
// 	public void setName(String name) {
// 		this.name = name;
// 	}
// 
// }
// 
// Path: src/main/java/cn/com/chenyixiao/rrs/entity/RestaurantFood.java
// @Entity
// @Table(name = "restaurant_food", catalog = "rrs")
// public class RestaurantFood {
// 	private long id;
// 	private long restaurantId;
// 	private long foodId;
// 	
// 	
// 	public RestaurantFood() {
// 	}
// 
// 
// 	public RestaurantFood(long id, long restaurantId, long foodId) {
// 		this.id = id;
// 		this.restaurantId = restaurantId;
// 		this.foodId = foodId;
// 	}
// 	
// 	
// 	@Id
// 	@GeneratedValue(strategy = GenerationType.IDENTITY)
// 	@Column(name = "id", unique = true, nullable = false)
// 	public long getId() {
// 		return id;
// 	}
// 	public void setId(long id) {
// 		this.id = id;
// 	}
// 	
// 	@Column(name = "restaurant_id")
// 	public long getRestaurantId() {
// 		return restaurantId;
// 	}
// 	public void setRestaurantId(long restaurantId) {
// 		this.restaurantId = restaurantId;
// 	}
// 	
// 	@Column(name = "food_id")
// 	public long getFoodId() {
// 		return foodId;
// 	}
// 	public void setFoodId(long foodId) {
// 		this.foodId = foodId;
// 	}
// 	
// 	
// }
// 
// Path: src/main/java/cn/com/chenyixiao/rrs/service/FoodService.java
// public interface FoodService {
// 
// 	public void addFood(Food food);
// 	public void updateFood(Food food);
// 	public Food getFood(Long id);
// 	public List<Food> getAllFoods();
// 	public void deleteFood(Long id);
// 	public void deleteAllFoods();
// 	
// 	public Long count();
// 	
// 	public Food findByName(String name);
// 	
// 	public List<Food> getFoodsByRestaurantId(Long restaurantId);
// }


import java.util.ArrayList;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import cn.com.chenyixiao.rrs.dao.FoodDAO;
import cn.com.chenyixiao.rrs.dao.RestaurantFoodDAO;
import cn.com.chenyixiao.rrs.entity.Food;
import cn.com.chenyixiao.rrs.entity.RestaurantFood;
import cn.com.chenyixiao.rrs.service.FoodService;
package cn.com.chenyixiao.rrs.service.impl;




@Service
@Transactional
public class FoodServiceImpl implements FoodService {

	@Autowired
// Path: src/main/java/cn/com/chenyixiao/rrs/dao/FoodDAO.java
// public interface FoodDAO {
// 
// 	public void addFood(Food food);
// 	public void updateFood(Food food);
// 	public Food getFood(Long id);
// 	public List<Food> getAllFoods();
// 	public void deleteFood(Long id);
// 	public void deleteAllFoods();
// 	
// 	public Long count();
// 	
// 	public Food findByName(String name);
// }
// 
// Path: src/main/java/cn/com/chenyixiao/rrs/dao/RestaurantFoodDAO.java
// public interface RestaurantFoodDAO {
// 
// 	public void addRestaurantFood(RestaurantFood restaurantFood);
// 	public void updateRestaurantFood(RestaurantFood restaurantFood);
// 	public RestaurantFood getRestaurantFood(Long id);
// 	public List<RestaurantFood> getAllRestaurantFoods();
// 	public void deleteRestaurantFood(Long id);
// 	public void deleteAllRestaurantFood();
// 	
// 	public Long count();
// 	
// 	public List<RestaurantFood> getRestaurantFoodsByRestaurantId(Long restaurantId);
// }
// 
// Path: src/main/java/cn/com/chenyixiao/rrs/entity/Food.java
// @Entity
// @Table(name = "food", catalog = "rrs")
// public class Food implements java.io.Serializable {
// 
// 	private long id;
// 	private String name;
// 
// 	public Food() {
// 	}
// 
// 	public Food(long id) {
// 		this.id = id;
// 	}
// 
// 	public Food(long id, String name) {
// 		this.id = id;
// 		this.name = name;
// 	}
// 
// 	@Id
// 	@GeneratedValue(strategy = GenerationType.IDENTITY)
// 	@Column(name = "id", unique = true, nullable = false)
// 	public long getId() {
// 		return this.id;
// 	}
// 
// 	public void setId(long id) {
// 		this.id = id;
// 	}
// 
// 	@Column(name = "name")
// 	public String getName() {
// 		return this.name;
// 	}
// 
// 	public void setName(String name) {
// 		this.name = name;
// 	}
// 
// }
// 
// Path: src/main/java/cn/com/chenyixiao/rrs/entity/RestaurantFood.java
// @Entity
// @Table(name = "restaurant_food", catalog = "rrs")
// public class RestaurantFood {
// 	private long id;
// 	private long restaurantId;
// 	private long foodId;
// 	
// 	
// 	public RestaurantFood() {
// 	}
// 
// 
// 	public RestaurantFood(long id, long restaurantId, long foodId) {
// 		this.id = id;
// 		this.restaurantId = restaurantId;
// 		this.foodId = foodId;
// 	}
// 	
// 	
// 	@Id
// 	@GeneratedValue(strategy = GenerationType.IDENTITY)
// 	@Column(name = "id", unique = true, nullable = false)
// 	public long getId() {
// 		return id;
// 	}
// 	public void setId(long id) {
// 		this.id = id;
// 	}
// 	
// 	@Column(name = "restaurant_id")
// 	public long getRestaurantId() {
// 		return restaurantId;
// 	}
// 	public void setRestaurantId(long restaurantId) {
// 		this.restaurantId = restaurantId;
// 	}
// 	
// 	@Column(name = "food_id")
// 	public long getFoodId() {
// 		return foodId;
// 	}
// 	public void setFoodId(long foodId) {
// 		this.foodId = foodId;
// 	}
// 	
// 	
// }
// 
// Path: src/main/java/cn/com/chenyixiao/rrs/service/FoodService.java
// public interface FoodService {
// 
// 	public void addFood(Food food);
// 	public void updateFood(Food food);
// 	public Food getFood(Long id);
// 	public List<Food> getAllFoods();
// 	public void deleteFood(Long id);
// 	public void deleteAllFoods();
// 	
// 	public Long count();
// 	
// 	public Food findByName(String name);
// 	
// 	public List<Food> getFoodsByRestaurantId(Long restaurantId);
// }


// Path: src/main/java/cn/com/chenyixiao/rrs/service/impl/FoodServiceImpl.java
import java.util.ArrayList;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import cn.com.chenyixiao.rrs.dao.FoodDAO;
import cn.com.chenyixiao.rrs.dao.RestaurantFoodDAO;
import cn.com.chenyixiao.rrs.entity.Food;
import cn.com.chenyixiao.rrs.entity.RestaurantFood;
import cn.com.chenyixiao.rrs.service.FoodService;

package cn.com.chenyixiao.rrs.service.impl;




@Service
@Transactional
public class FoodServiceImpl implements FoodService {

	@Autowired
	private FoodDAO foodDAO;